Codeignter 3 how install a third_part class |
Hi , sorry for english , im tryng to install https://github.com/paypal/Payouts-PHP-SDK in codeigniter how can i do ?
Im tryng to insert it in vendor and with $config['composer_autoload'] = TRUE ; but if i call $request = new PayoutsPostRequest(); i have Message: Class 'PayoutsPostRequest' not found The other class (facebook and google login work fine inside vendor folder) Its better insert the sdk in third party ?
(06-11-2020, 04:13 PM)ivantcholakov Wrote: Thanks work fine but i have some answer for you : In this package there is a folder called sample with some classes , how can i create an istance of CreatePayoutSample ( this class are in sample folder) ? How can i set correct path to a class ( \PaypalPayoutsSDK\Payouts\PayoutsPostRequest is inside lib) ? in this folder there is a class calle PayPalClient where must insert the cofiguration , how can i modify to get the configuration variable from my application/config/paypal.php file
1.
Maybe it would be convenient if you make a CI3-style library that extends \PaypalPayoutsSDK\Payouts\PayoutsPostRequest application/libraries/Payouts_post_request.php : Code: <?php defined('BASEPATH') OR exit('No direct script access allowed.'); application/config/payouts_post_request.php - should contain configuration options: Code: $config['SomeOption'] = 'hksdhfkjfkasfu'; And then load as an ordinary library and access its methods: Code: $this->load->library('payouts_post_request'); The library is a singleton, so if you use it twice or more times with different options you should provide a method for resetting its internal data. Here is another example with detailed explanations of this idea: https://forum.codeigniter.com/thread-61112.html 2. But if usage of these classes within the package is more complex, then use them directly, make a separate special configuration file application/config/paypal.php and load its content when it is needed: Code: $paypal_config = $this->load->config('paypal', TRUE); Pass the elements of the array $paypal_config as parameters where it is appropriate.
(06-12-2020, 03:15 AM)ivantcholakov Wrote: 1. Tank you so much , the last answer , are you expert on paypal ? Because i must do a payout , with curl i can do a payout and i can get the sender_batch_id , i use this with curl to get the transaction id of paypal , the problem is that this payment is asincronous and i must implement a webhook to listen the response . I cannot find code expecially where i must the url of webook in my code , or is webhook alwais listening ?
|
Welcome Guest, Not a member yet? Register Sign In |