mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Attach payment_id to payment_hash
This commit is contained in:
parent
100ca67c5f
commit
d071ed0d3b
@ -104,6 +104,9 @@ class AuthorizeCreditCard
|
||||
$payment = $this->createPaymentRecord($data, $amount);
|
||||
$payment->meta = $cgt->meta;
|
||||
$payment->save();
|
||||
|
||||
$payment_hash->payment_id = $payment->id;
|
||||
$payment_hash->save();
|
||||
|
||||
$this->authorize->attachInvoices($payment, $payment_hash);
|
||||
$payment->service()->updateInvoicePayment($payment_hash);
|
||||
@ -144,6 +147,9 @@ class AuthorizeCreditCard
|
||||
$amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
|
||||
|
||||
$payment = $this->createPaymentRecord($data, $amount);
|
||||
|
||||
$payment_hash->payment_id = $payment->id;
|
||||
$payment_hash->save();
|
||||
|
||||
$this->authorize->attachInvoices($payment, $payment_hash);
|
||||
|
||||
|
@ -219,6 +219,9 @@ class CheckoutComPaymentDriver extends BaseDriver
|
||||
|
||||
$payment = $this->createPayment($data, Payment::STATUS_COMPLETED);
|
||||
$payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$state['payment_hash']])->firstOrFail();
|
||||
$payment_hash->payment_id = $payment->id;
|
||||
$payment_hash->save();
|
||||
|
||||
$this->attachInvoices($payment, $payment_hash);
|
||||
$payment->service()->updateInvoicePayment($payment_hash);
|
||||
|
||||
|
@ -162,6 +162,10 @@ class PayPalExpressPaymentDriver extends BasePaymentDriver
|
||||
|
||||
$payment = $this->createPayment($response->getData());
|
||||
$payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$request->input('payment_hash')])->firstOrFail();
|
||||
|
||||
$payment_hash->payment_id = $payment->id;
|
||||
$payment_hash->save();
|
||||
|
||||
$this->attachInvoices($payment, $payment_hash);
|
||||
$payment->service()->updateInvoicePayment($payment_hash);
|
||||
|
||||
|
@ -167,6 +167,9 @@ class Charge
|
||||
$payment->meta = $cgt->meta;
|
||||
$payment->save();
|
||||
|
||||
$payment_hash->payment_id = $payment->id;
|
||||
$payment_hash->save();
|
||||
|
||||
$this->stripe->attachInvoices($payment, $payment_hash);
|
||||
|
||||
$payment->service()->updateInvoicePayment($payment_hash);
|
||||
|
@ -197,6 +197,11 @@ class CreditCard
|
||||
|
||||
$payment = $this->stripe->createPayment($data, $status = Payment::STATUS_COMPLETED);
|
||||
$payment->meta = $payment_meta;
|
||||
$payment->save();
|
||||
|
||||
$payment_hash = $state['payment_hash'];
|
||||
$payment_hash->payment_id = $payment->id;
|
||||
$payment_hash->save();
|
||||
|
||||
$payment = $this->stripe->attachInvoices($payment, $state['payment_hash']);
|
||||
|
||||
|
@ -40,7 +40,11 @@ class AddIsPublicToDocumentsTable extends Migration
|
||||
$table->decimal('fee_total', 16, 4);
|
||||
$table->unsignedInteger('fee_invoice_id')->nullable();
|
||||
$table->mediumText('data');
|
||||
$table->unsignedInteger('payment_id')->nullable();
|
||||
$table->timestamps(6);
|
||||
|
||||
$table->foreign('payment_id')->references('id')->on('payments')->onDelete('cascade')->onUpdate('cascade');
|
||||
|
||||
});
|
||||
|
||||
Schema::table('recurring_invoices', function ($table) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user