Plugin Directory

Changeset 3261496


Ignore:
Timestamp:
03/25/2025 11:34:14 AM (11 months ago)
Author:
razorpay
Message:

Update: 1.0.4

Location:
razorpay-payment-button-for-siteorigin/trunk
Files:
93 added
13 edited

Legend:

Unmodified
Added
Removed
  • razorpay-payment-button-for-siteorigin/trunk/razorpay-payment-buttons.php

    r2744130 r3261496  
    55 * Plugin URI:  https://github.com/razorpay/payment-button-siteorigin-plugin
    66 * Description: Razorpay Payment Button for SiteOrigin
    7  * Version:     1.0.3
     7 * Version:     1.0.4
    88 * Author:      Razorpay
    99 * Author URI:  https://razorpay.com
  • razorpay-payment-button-for-siteorigin/trunk/razorpay-sdk/Razorpay.php

    r2744130 r3261496  
    99if (class_exists('WpOrg\Requests\Autoload') === false)
    1010{
    11     require_once __DIR__.'/libs/Requests-2.0.0/src/Autoload.php';
     11    require_once __DIR__.'/libs/Requests-2.0.4/src/Autoload.php';
    1212}
    1313
  • razorpay-payment-button-for-siteorigin/trunk/razorpay-sdk/src/Api.php

    r2721073 r3261496  
    55class Api
    66{
    7     protected static $baseUrl = 'https://api.razorpay.com/v1/';
     7    protected static $baseUrl = 'https://api.razorpay.com';
    88
    99    protected static $key = null;
     
    1717    public static $appsDetails = array();
    1818
    19     const VERSION = '2.8.3';
     19    const VERSION = '2.9.0';
    2020
    2121    /**
     
    8585    }
    8686
    87     public static function getFullUrl($relativeUrl)
     87    public static function getFullUrl($relativeUrl, $apiVersion = "v1")
    8888    {
    89         return self::getBaseUrl() . $relativeUrl;
     89        return self::getBaseUrl() . "/". $apiVersion . "/". $relativeUrl;
    9090    }
    9191}
  • razorpay-payment-button-for-siteorigin/trunk/razorpay-sdk/src/Card.php

    r2678240 r3261496  
    1212        return parent::fetch($id);
    1313    }
     14
     15    public function requestCardReference($attributes = array())
     16    {
     17        $entityUrl = $this->getEntityUrl() . '/fingerprints';
     18
     19        return $this->request('POST', $entityUrl, $attributes);
     20    }
    1421}
  • razorpay-payment-button-for-siteorigin/trunk/razorpay-sdk/src/Customer.php

    r2678240 r3261496  
    3838        return $token;
    3939    }
     40
     41    public function addBankAccount($attributes = array())
     42    {
     43        $entityUrl = $this->getEntityUrl().$this->id. '/bank_account';
     44
     45        return $this->request('POST', $entityUrl, $attributes);
     46    }
     47
     48    public function deleteBankAccount($bank_id)
     49    {
     50        $entityUrl = $this->getEntityUrl() . $this->id. '/bank_account/'. $bank_id;
     51
     52        return $this->request('DELETE', $entityUrl);
     53    }
     54
     55    public function requestEligibilityCheck($attributes = array())
     56    {
     57        $entityUrl = $this->getEntityUrl(). '/eligibility';
     58
     59        return $this->request('POST', $entityUrl, $attributes);
     60    }
     61
     62    public function fetchEligibility($id)
     63    {
     64        $entityUrl = $this->getEntityUrl(). '/eligibility/'. $id;
     65
     66        return $this->request('GET', $entityUrl);
     67    }
    4068}
  • razorpay-payment-button-for-siteorigin/trunk/razorpay-sdk/src/Entity.php

    r2678240 r3261496  
    8383     * @param array  $data
    8484     * @param array  $additionHeader
     85     * @param string $apiVersion
    8586     *
    8687     * @return Entity
    8788     */
    88     protected function request($method, $relativeUrl, $data = null)
     89    protected function request($method, $relativeUrl, $data = null, $apiVersion = "v1")
    8990    {
    9091        $request = new Request();
    9192
    92         $response = $request->request($method, $relativeUrl, $data);
     93        $response = $request->request($method, $relativeUrl, $data, $apiVersion);
    9394
    9495        if ((isset($response['entity'])) and ($response['entity'] == $this->getEntity()))
     
    231232        return $array;
    232233    }
     234
     235    public function setFile($attributes)
     236    {
     237        if(isset($attributes['file'])){
     238            $attributes['file'] = new \CURLFILE(
     239                $attributes['file'],
     240                mime_content_type($attributes['file'])
     241            );
     242        }
     243
     244        return $attributes;   
     245    }
    233246}
  • razorpay-payment-button-for-siteorigin/trunk/razorpay-sdk/src/Order.php

    r2678240 r3261496  
    22
    33namespace Razorpay\Api;
     4
     5use Requests;
    46
    57class Order extends Entity
     
    1012    public function create($attributes = array())
    1113    {
     14        $attributes = json_encode($attributes);
     15
     16        Request::addHeader('Content-Type', 'application/json');
     17
    1218        return parent::create($attributes);
    1319    }
     
    4349        return $this->request('GET', $relativeUrl, $options);
    4450    }
     51
     52    public function viewRtoReview()
     53    {
     54        $relativeUrl = $this->getEntityUrl(). $this->id .'/rto_review';
     55
     56        return $this->request('POST', $relativeUrl);
     57    }
     58
     59    public function editFulfillment($attributes = array())
     60    {
     61        $relativeUrl = $this->getEntityUrl(). $this->id .'/fulfillment';
     62
     63        return $this->request('POST', $relativeUrl, $attributes);
     64    }
    4565}
  • razorpay-payment-button-for-siteorigin/trunk/razorpay-sdk/src/Payment.php

    r2678240 r3261496  
    163163    }
    164164    /**
    165      * submit otp
     165     * Submit otp
    166166     *
    167167     * @param id $id
     
    183183     * @param array $attributes
    184184     */
    185     public function otpGenerate()
    186     {
    187         $relativeUrl = $this->getEntityUrl(). $this->id . '/otp_generate';
     185    public function otpGenerate($id)
     186    {
     187        $relativeUrl = $this->getEntityUrl(). $id . '/otp_generate';
    188188
    189189        return $this->request('POST', $relativeUrl);
    190190    }
    191191
     192    /**
     193     * Resend otp
     194     *
     195     * @param id $id
     196     *
     197     * @param array $attributes
     198     */
     199    public function otpResend()
     200    {
     201        $relativeUrl = $this->getEntityUrl(). $this->id . '/otp/resend';
     202
     203        return $this->request('POST', $relativeUrl);
     204    }
     205   
     206    public function createUpi($attributes = array())
     207    {
     208        $relativeUrl = $this->getEntityUrl() . 'create/upi';
     209
     210        return $this->request('POST', $relativeUrl, $attributes);
     211    }
     212
     213    public function validateVpa($attributes = array())
     214    {
     215        $relativeUrl = $this->getEntityUrl() . 'validate/vpa';
     216
     217        return $this->request('POST', $relativeUrl, $attributes);
     218    }
     219
     220    public function fetchPaymentMethods()
     221    {
     222        $relativeUrl = 'methods';
     223
     224        return $this->request('GET', $relativeUrl);
     225    }
     226
     227    public function expandedDetails($options = array())
     228    {
     229        $relativeUrl = $this->getEntityUrl(). $this->id;
     230
     231        return $this->request('GET', $relativeUrl, $options);
     232    }
    192233}
  • razorpay-payment-button-for-siteorigin/trunk/razorpay-sdk/src/Request.php

    r2678240 r3261496  
    3636     * @param  array $data Data to be passed along the request
    3737     * @param  array $additionHeader headers to be passed along the request
     38     * @param  string $apiVersion version to be passed along the request
    3839     * @return array Response data in array format. Not meant
    3940     * to be used directly
    4041     */
    41     public function request($method, $url, $data = array())
    42     {
    43         $url = Api::getFullUrl($url);
     42    public function request($method, $url, $data = array(), $apiVersion = "v1")
     43    { 
     44        $url = Api::getFullUrl($url, $apiVersion);
    4445
    4546        $hooks = new Requests_Hooks();
  • razorpay-payment-button-for-siteorigin/trunk/razorpay-sdk/src/Settlement.php

    r2678240 r3261496  
    6666     * fetch Ondemand Settlement by Id
    6767     * @param  string $id
     68     * @param  array  $options
    6869     * @return array
    6970     */
    70     public function fetchOndemandSettlementById()
     71    public function fetchOndemandSettlementById($id, $options = array())
    7172    {
    72         $relativeUrl = $this->getEntityUrl(). "ondemand/" . $this->id ;
     73        $relativeUrl = $this->getEntityUrl(). "ondemand/" . $id;
    7374       
    74         return $this->request('GET', $relativeUrl);
     75        return $this->request('GET', $relativeUrl, $options);
    7576    }
    7677    /**
     
    7879     * @return array
    7980     */
    80     public function fetchAllOndemandSettlement()
     81    public function fetchAllOndemandSettlement($options = array())
    8182    {
    8283        $relativeUrl = $this->getEntityUrl(). "ondemand/";
    8384       
    84         return $this->request('GET', $relativeUrl);
     85        return $this->request('GET', $relativeUrl, $options);
    8586    }
    8687}
  • razorpay-payment-button-for-siteorigin/trunk/razorpay-sdk/src/Token.php

    r2678240 r3261496  
    44
    55class Token extends Entity
    6 {
     6{   
     7   
     8    public function create($attributes = array())
     9    {
     10        $url = $this->getEntityUrl();     
     11       
     12        return $this->request('POST', $url, $attributes);
     13    }
     14
    715    /**
    816     * @param $id Token id
     
    1321
    1422        return $this->request('GET', $relativeUrl);
     23    }
     24
     25    public function fetchCardPropertiesByToken($attributes = array())
     26    {
     27        $relativeUrl = $this->getEntityUrl(). '/fetch';
     28
     29        return $this->request('POST', $relativeUrl, $attributes);
    1530    }
    1631
     
    2843        return $this->request('DELETE', $relativeUrl);
    2944    }
     45
     46    public function deleteToken($attributes = array())
     47    {
     48        $relativeUrl = $this->getEntityUrl(). '/delete';
     49
     50        return $this->request('POST', $relativeUrl, $attributes);
     51    }
     52
     53    public function processPaymentOnAlternatePAorPG($attributes = array())
     54    {
     55        $relativeUrl = $this->getEntityUrl().'service_provider_tokens/token_transactional_data';
     56
     57        return $this->request('POST', $relativeUrl, $attributes);
     58    }
    3059}
  • razorpay-payment-button-for-siteorigin/trunk/razorpay-sdk/src/Webhook.php

    r2678240 r3261496  
    1111    public function create($attributes = array())
    1212    {
     13        if(isset($this->account_id))
     14        {
     15            $url = 'accounts/'. $this->account_id . '/' .$this->getEntityUrl();     
     16       
     17            return $this->request('POST', $url, $attributes, 'v2');
     18        }
    1319        return parent::create($attributes);
    1420    }
     
    1622    public function fetch($id)
    1723    {
     24        if(isset($this->account_id))
     25        {
     26            $url = 'accounts/'. $this->account_id . '/' .$this->getEntityUrl() . $id;     
     27
     28            return $this->request('GET', $url, null, 'v2');
     29        }
    1830        return parent::fetch($id);
    1931    }
     
    2133    public function all($options = array())
    2234    {
     35        if(isset($this->account_id))
     36        {
     37            $url = 'accounts/'. $this->account_id . '/' .$this->getEntityUrl();     
     38       
     39            return $this->request('GET', $url, $options, 'v2');
     40        }
    2341        return parent::all($options);
    2442    }
     
    2846     *
    2947     * @param array $attributes
    30      *
    31      * @return Webhooks
     48     * @param string $id
     49     * @return Webhook
    3250     */
    33     public function edit($attributes = array(), $id)
     51    public function edit($attributes, $id)
    3452    {
    3553        $url = $this->getEntityUrl() . $id;
    36 
     54       
     55        if(isset($this->account_id))
     56        {
     57            $url = 'accounts/'.$this->account_id .'/'. $url;     
     58       
     59            return $this->request('PATCH', $url, $attributes, 'v2');
     60        }
    3761        return $this->request(Requests::PUT, $url, $attributes);
    3862    }
     63
     64    public function delete($id)
     65    {
     66        $url = 'accounts/'. $this->account_id . '/' .$this->getEntityUrl(). $id;     
     67       
     68        return $this->request('DELETE', $url, null, 'v2');
     69    }
    3970}
  • razorpay-payment-button-for-siteorigin/trunk/readme.txt

    r2744130 r3261496  
    22Contributors: Razorpay
    33Tags: Payment gateway, Donate button, UPI/credit/debit card, Payment plugin, India
    4 Tested up to: 6.0
    5 Stable tag: 1.0.3
     4Tested up to: 6.7
     5Stable tag: 1.0.4
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9393== Changelog ==
    9494
     95= 1.0.4 =
     96* Updated SDK to 2.9.0
     97
    9598= 1.0.3 =
    9699* Fix fatal error: Cannot use isset() on the result of an expression
Note: See TracChangeset for help on using the changeset viewer.