mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Create Payment Type + Adapt Payment class
This commit is contained in:
parent
925450df9b
commit
80500b4c0a
@ -45,8 +45,9 @@ class PaymentType extends StaticModel
|
||||
const MOLLIE_BANK_TRANSFER = 34;
|
||||
const KBC = 35;
|
||||
const BANCONTACT = 36;
|
||||
const IDEAL = 37;
|
||||
const IDEAL = 37;
|
||||
const HOSTED_PAGE = 38;
|
||||
const PRZELEWY24 = 40;
|
||||
|
||||
public static function parseCardType($cardName)
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ class PRZELEWY24
|
||||
|
||||
public function authorizeView($data)
|
||||
{
|
||||
return render('gateways.stripe.sofort.authorize', $data);
|
||||
return render('gateways.stripe.przelewy24.authorize', $data);
|
||||
}
|
||||
|
||||
public function paymentView(array $data)
|
||||
@ -48,7 +48,7 @@ class PRZELEWY24
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['sofort'],
|
||||
'payment_method_types' => ['p24'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices') . ': ' . collect($data['invoices'])->pluck('invoice_number')),
|
||||
|
||||
@ -59,7 +59,7 @@ class PRZELEWY24
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
return render('gateways.stripe.sofort.pay', $data);
|
||||
return render('gateways.stripe.przelewy24.pay', $data);
|
||||
}
|
||||
|
||||
private function buildReturnUrl(): string
|
||||
@ -67,7 +67,7 @@ class PRZELEWY24
|
||||
return route('client.payments.response', [
|
||||
'company_gateway_id' => $this->stripe->company_gateway->id,
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'payment_method_id' => GatewayType::SOFORT,
|
||||
'payment_method_id' => GatewayType::PRZELEWY24,
|
||||
]);
|
||||
}
|
||||
|
||||
@ -91,10 +91,10 @@ class PRZELEWY24
|
||||
|
||||
$data = [
|
||||
'payment_method' => $payment_intent,
|
||||
'payment_type' => PaymentType::SOFORT,
|
||||
'payment_type' => PaymentType::PRZELEWY24,
|
||||
'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->stripe_amount, $this->stripe->client->currency()->precision, $this->stripe->client->currency()),
|
||||
'transaction_reference' => $payment_intent,
|
||||
'gateway_type_id' => GatewayType::SOFORT,
|
||||
'gateway_type_id' => GatewayType::PRZELEWY24,
|
||||
];
|
||||
|
||||
$this->stripe->createPayment($data, Payment::STATUS_PENDING);
|
||||
|
Loading…
x
Reference in New Issue
Block a user