Passed
Push — v3.0 ( bac5d5...2d99c7 )
by Raza
01:59
created

Helpers::setupOrderConfirmation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Srmklive\PayPal\Traits\PayPalAPI\Orders;
4
5
use Carbon\Carbon;
6
use Illuminate\Support\Str;
7
use Throwable;
8
9
trait Helpers
10
{
11
    /**
12
     * Confirm payment for an order.
13
     *
14
     * @param string $order_id
15
     * @param string $processing_instruction
16
     *
17
     * @throws Throwable
18
     *
19
     * @return array|\Psr\Http\Message\StreamInterface|string
20
     */
21
    public function setupOrderConfirmation(string $order_id, string $processing_instruction = '')
22
    {
23
        $body = [
24
            'processing_instruction' => $processing_instruction,
25
            'application_context'    => $this->experience_context,
26
            'payment_source'         => $this->payment_source,
27
        ];
28
29
        return $this->confirmOrder($order_id, $body);
0 ignored issues
show
Bug introduced by
It seems like confirmOrder() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
        return $this->/** @scrutinizer ignore-call */ confirmOrder($order_id, $body);
Loading history...
30
    }
31
}
32