Skip to content

suhas-cashfree/testphp

Repository files navigation

cashfree-pg-php-sdk

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Installation & Usage

Requirements

PHP 7.3 and later. Should also work with PHP 8.0 but has not been tested.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/cashfree-pg-php-sdk/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');




$apiInstance = new OpenAPI\Client\Api\OrdersApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$x_client_id = 'x_client_id_example'; // string
$x_client_secret = 'x_client_secret_example'; // string
$x_api_version = '2022-01-01'; // string
$x_idempotency_replayed = false; // bool
$x_idempotency_key = 'x_idempotency_key_example'; // string
$x_request_id = 'x_request_id_example'; // string
$cf_order_request = new \OpenAPI\Client\Model\CFOrderRequest(); // \OpenAPI\Client\Model\CFOrderRequest

try {
    $result = $apiInstance->createOrder($x_client_id, $x_client_secret, $x_api_version, $x_idempotency_replayed, $x_idempotency_key, $x_request_id, $cf_order_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrdersApi->createOrder: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://sandbox.cashfree.com/pg

Class Method HTTP request Description
OrdersApi createOrder POST /orders Create Order
OrdersApi getOrder GET /orders/{order_id} Get Order
OrdersApi orderPay POST /orders/pay Order Pay
OrdersApi preauthorization POST /orders/{order_id}/authorization Preauthorization
PaymentLinksApi cancelPaymentLink POST /links/{link_id}/cancel Cancel Payment Link
PaymentLinksApi createPaymentLink POST /links Create Payment Link
PaymentLinksApi getPaymentLinkDetails GET /links/{link_id} Fetch Payment Link Details
PaymentLinksApi getPaymentLinkOrders GET /links/{link_id}/orders Get Orders for a Payment Link
PaymentsApi getPaymentbyId GET /orders/{order_id}/payments/{cf_payment_id} Get Payment by ID
PaymentsApi getPaymentsfororder GET /orders/{order_id}/payments Get Payments for an Order
RefundsApi createrefund POST /orders/{order_id}/refunds Create Refund
RefundsApi getRefund GET /orders/{order_id}/refunds/{refund_id} Get Refund
RefundsApi getallrefundsfororder GET /orders/{order_id}/refunds Get All Refunds for an Order
SettlementsApi getsettlements GET /orders/{order_id}/settlements Get Settlements
TokenVaultApi deleteSpecificSavedInstrument DELETE /customers/{customer_id}/instruments/{instrument_id} Delete Saved Instrument
TokenVaultApi fetchAllSavedInstruments GET /customers/{customer_id}/instruments Fetch All Saved Instruments
TokenVaultApi fetchCryptogram GET /customers/{customer_id}/instruments/{instrument_id}/cryptogram Fetch cryptogram for saved instrument
TokenVaultApi fetchSpecificSavedInstrument GET /customers/{customer_id}/instruments/{instrument_id} Fetch Single Saved Instrument

Models

Authorization

All endpoints do not require authorization.

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

nextgenapi@cashfree.com

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 2022-01-01
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published