File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -11,14 +11,16 @@ class Factory
1111 * @var AdapterInterface
1212 */
1313 protected $ gateway ;
14- /**
15- * @param $adapter
16- * @param TransactionInterface $invoice
17- *
18- * @return $this
19- * @throws \Tartan\Larapay\Exception
20- */
21- public function make ($ adapter , TransactionInterface $ invoice )
14+
15+ /**
16+ * @param $adapter adapter name
17+ * @param TransactionInterface $invoice
18+ * @param array adapter configuration
19+ *
20+ * @return $this
21+ * @throws Exception
22+ */
23+ public function make ($ adapter , TransactionInterface $ invoice , array $ adapterConfig = [])
2224 {
2325 $ adapter = ucfirst (strtolower ($ adapter ));
2426
@@ -41,7 +43,7 @@ public function make($adapter, TransactionInterface $invoice)
4143 throw new Exception ("Adapter class ' $ adapterName' does not exist " );
4244 }
4345
44- $ config = config ('larapay. ' .strtolower ($ adapter ));
46+ $ config = count ( $ adapterConfig ) ? $ adapterConfig : config ('larapay. ' .strtolower ($ adapter ));
4547 Log::debug ('init gateway config ' , $ config );
4648
4749 $ bankAdapter = new $ adapterName ($ invoice , $ config );
You can’t perform that action at this time.
0 commit comments