PHPackages                             papara/papara - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. papara/papara

ActiveLibrary[API Development](/categories/api)

papara/papara
=============

Papara PHP Client Library

v1.0.5(4y ago)33.1k6[3 PRs](https://github.com/paparateam/merchantApiClient-php/pulls)MITPHPPHP &gt;=5.6.0

Since Oct 23Pushed 4y ago5 watchersCompare

[ Source](https://github.com/paparateam/merchantApiClient-php)[ Packagist](https://packagist.org/packages/papara/papara)[ RSS](/packages/papara-papara/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (7)Used By (0)

Table of Contents
=================

[](#table-of-contents)

[Intro](#intro)

[Enums](#enums)

[Account](#account)

[Banking](#banking)

[Cash Deposit](#cash-deposit)

[Mass Payment](#mass-payment)

[Recurring Mass Payment](#recurring-mass-payment)

[Payments](#payments)

[Validation](#validation)

[Response Types](#response-types)

Intro
======================================

[](#intro)

Integrating Papara into your software requires following;

1. Obtain your API Key. So Papara can authenticate integration’s API requests. To obtain your API Key, follow  URL. After sucessfully logged in, API Key can be viewed on
2. Install client library. So your integration can interact with the Papara API. Install operations are like following.

Configuration
=============

[](#configuration)

Client can be created with class or standard way;

Standard way:

```
require_once('PATH_TO_PAPARA/bootstrap.php');

use \Papara\PaparaClient;
$client = new PaparaClient('YOUR_PAPARA_API_KEY', true);
```

Or object oriented way:

```
use Papara\PaparaClient;

class AccountServiceTests {
  private PaparaClient $client;

  public function __construct()
  {
    $this->client = new PaparaClient($this->config['ApiKey'], true);
  }
}
```

Composer operations
-------------------

[](#composer-operations)

```
# Install via composer
composer require papara/papara
```

Enums
======================================

[](#enums)

CashDepositProvisionStatus
==========================

[](#cashdepositprovisionstatus)

When a cash deposit request was made, following statuses will return and display the status of provision.

**Key****Value****Description**Pending0Cash deposit is pending provision.Complete1Cash Deposit is completedCancel2Cash Deposit is cancelledReadyToComplete3Cash Deposit is ready for completionCurrency
========

[](#currency)

All currencies on the API are listed below.

**Key****Value****Description**TRY0Turkish LiraUSD1U.S DollarEUR2EuroEntryType
=========

[](#entrytype)

Entry types are used in ledgers and cash deposits in order to track the money in the operation. Possible entry types are listed below.

**Key****Value****Description**BankTransfer1Bank Transfer: Cash deposit or withdrawalCorporateCardTransaction2Papara Corporate Card Transaction: Transaction which was operated by corporation card assigned to merchantLoadingMoneyFromPhysicalPoint6Loading Money From Physical Point: Cash deposit operation from contracted locationMerchantPayment8Merchant Payment: Checkout via PaparaPaymentDistribution9Payment Distribution: Masspayment via paparaEduPos11Offline payment. EDU POS via PaparaPaymentMethod
=============

[](#paymentmethod)

Three types of payment is accepted in the system. Possible payment methods are listed below.

**Key****Value****Description**PaparaAccount0Papara Account BalanceCard1Registered Credit CardMobile2Mobile PaymentPaymentStatus
=============

[](#paymentstatus)

After a payment was done, API returns the payment status which are shown below.

**Key****Value****Description**Pending0Payment waitingCompleted1User completed the paymentRefunded2Order refundedAccount
==========================================

[](#account)

This part contains the technical integration information prepared for the use of the account and balance information of the merchant. Account and balance information on Papara account can be retrieved by Account service. Developers can also retrieve the balance history, which contains a list of transactions that contributed to the balance.

Get Account Information
-----------------------

[](#get-account-information)

Returns the merchant account and balance information. Balance information contains current balance, available funds and unavailable funds, whilst account information contains brand name and full title of the merchant. To perform this operation use `GetAccount` method on `Account` service.

### Account Model

[](#account-model)

`Account` contains account information that returns from API.

**Variable Name****Type****Description**LegalNamestringReturns merchant’s company title.BrandNamestringReturns brand name.AllowedPaymentTypesListReturns allowed payment types.BalancesListReturns account balances### AllowedPaymentType

[](#allowedpaymenttype)

`AllowedPaymentType` displays allowed payment types.

**Variable Name****Type****Description**PaymentMethodintReturns payment method.
0 - Papara Account Balance
1 - Credit/Debit Card
2 - Mobile - Mobile Payment.### AccountBalance

[](#accountbalance)

`AccountBalance` shows current balance figures and lists three types of balances and general currency.

**Variable Name****Type****Description**CurrencyintReturns currencyTotalBalancefloatReturns total balanceLockedBalancefloatReturns locked balanceAvailableBalancefloatReturns available balance### Service Method

[](#service-method)

#### Purpose

[](#purpose)

Return account information and current balance for authorized merchant.

**Method****Params****Return Type**GetAccountNonePaparaResult#### Usage

[](#usage)

```
  /**
   * Returns account information and current balance for authorized merchant.
   *
   * @return PaparaResult
   */
  public function GetAccount()
  {
    $result = $this->client->AccountService->GetAccount();
    return $result;
  }
```

List Ledgers
------------

[](#list-ledgers)

Returns the merchant account history (list of transactions) in paged format. This method is used for listing all transactions made for a merchant including resulting balance for each transaction. To perform this operation use `ListLedgers` method on `Account` service. `startDate` and `endDate` should be provided.

### AccountLedger

[](#accountledger)

`AccountLedger` represents a transaction itself that returns from API.

**Variable Name****Type****Description**IDintReturns merchant IDCreatedAtDateTimeReturns created date of a ledgerEntryTypeEntryTypeReturns entry typeEntryTypeNamestringReturns entry type nameAmountfloatReturns amountFeefloatReturns feeCurrencyintReturns currencyCurrencyInfoCurrencyInfoReturns currency informationResultingBalancefloatReturns resulting balanceDescriptionstringReturns descriptionMassPaymentIdstringReturns mass payment Id. It is the unique value sent by the merchant to prevent duplicate repetition in payment transactions. It is displayed in transaction records of masspayment type in account transactions to ensure control of the transaction. It will be null in other payment types.CheckoutPaymentIdstringReturns checkout payment ID. It is the ID field in the data object in the payment record transaction. It is the unique identifier of the payment transaction. It is displayed in transaction records of checkout type in account transactions. It will be null in other payment types.CheckoutReferenceIDstringReturns checkout reference ID. This is the referenceId field sent when creating the payment transaction record. It is the reference information of the payment transaction in the merchant system. It is displayed in transaction records of checkout type in account transactions. It will be null in other payment types### CurrencyInfo

[](#currencyinfo)

`CurrencyInfo` represents the currency information available in a ledger that returns from API.

**Variable Name****Type****Description**CurrencyEnumCurrencyReturns currency type.SymbolstringReturns currency symbolCodestringReturns currency codePreferredDisplayCodestringReturns currency's preferred display codeNamestringReturns currency nameIsCryptoCurrencyboolReturns if it is a cryptocurrency or notPrecisionintReturns currency precisionIconUrlstringReturns currency icon URL### LedgerListOptions Model

[](#ledgerlistoptions-model)

`LedgerListOptions` is used by account service for providing request parameters for ledger listing operation.

**Variable Name****Type****Description**startDateDateTimeGets or sets start date for transactionsendDateDateTimeGets or sets end date for transactionsentryTypeenumGets or sets entry typesaccountNumberintGets or sets merchant account numberpageintGets or sets the requested page number. If the requested date has more than 1 page of results for the requested PageSize, use this to iterate through pagespageSizeintGets or sets number of elements you want to receive per request page. Min=1, Max=50### Service Method

[](#service-method-1)

#### Purpose

[](#purpose-1)

Returns list of ledgers for authorized merchant.

**Method****Params****Return Type**ListLedgersLedgerListOptionsPaparaResult#### Usage

[](#usage-1)

```
  /**
   * Returns list of ledgers for authorized merchant.
   *
   * @param LedgerListOptions $options
   * @return PaparaResult
   */
  public function ListLedgers()
  {
    $options = new LedgerListOptions;
    $options->startDate = "2020-01-01T00:00:00.000Z";
    $options->endDate = "2020-09-01T00:00:00.000Z";
    $options->page = 1;
    $options->pageSize = 20;

    $result = $this->client->AccountService->ListLedgers($options);
    return $result;
  }
```

Get Settlement
--------------

[](#get-settlement)

Calculates the count and volume of transactions within the given time period. To perform this operation use `GetSettlement` method on `Account` service. `startDate` and `endDate` should be provided.

### Settlement Model

[](#settlement-model)

`Settlement` is used by account service to match returning settlement values API.

**Variable Name****Type****Description**CountintReturns transaction countVolumeintReturns transaction volume### SettlementGetOptions Model

[](#settlementgetoptions-model)

`SettlementGetOptions` is used by account service for providing settlement request parameters.

**Variable Name****Type****Description**startDateDateTimeGets or sets start date for transactionsendDateDateTimeGets or sets end date for transactionsentryTypeEntryTypeGets or sets entry types### Service Method

[](#service-method-2)

#### Purpose

[](#purpose-2)

Returns settlement for authorized merchant.

**Method****Params****Return Type**GetSettlementSettlementGetOptionsPaparaResult#### Usage

[](#usage-2)

```
  /**
   * Returns settlement for authorized merchant.
   *
   * @param SettlementGetOptions $options
   * @return PaparaResult
   */
  public function GetSettlement()
  {
    $options = new SettlementGetOptions;
    $options->startDate = "2020-01-01T00:00:00.000Z";
    $options->endDate = "2020-09-01T00:00:00.000Z";

    $result = $this->client->AccountService->GetSettlement($options);
    return $result;
  }
```

Banking
==========================================

[](#banking)

This part contains technical integration information prepared for merchants those who want to quickly and securely list their bank accounts with Papara and/or create a withdrawal request to their bank accounts.

Get Bank Accounts
-----------------

[](#get-bank-accounts)

Retrieves registered bank accounts of the merchant. To perform this operation use `GetBankAccounts` method on `Banking` service.

### BankAccount Model

[](#bankaccount-model)

`BankAccount` contains bank account information.

**Variable Name****Type****Description**BankAccountIdint?Returns merchant's bank account IDBankNamestringReturns merchant bank nameBranchCodestringReturns merchant branch codeIbanstringReturns IBAN NumberAccountCodestringReturns merchant account codeDescriptionstringReturns descriptionCurrencystringReturns currency### Service Method

[](#service-method-3)

#### Purpose

[](#purpose-3)

Returns bank accounts for authorized merchant.

**Method****Params****Return Type**GetBankAccountsPaparaResult#### Usage

[](#usage-3)

```
  /**
   * Returns bank accounts for authorized merchant.
   *
   * @return PaparaResult
   */
  public function GetBankAccounts()
  {
	$result = $this->client->BankingService->GetBankAccounts();
    return $result;
  }
```

Withdrawal
----------

[](#withdrawal)

Generates withdrawal requests for merchants. To perform this operation use `Withdrawal` method on `Banking` service.

### BankingWithdrawalOptions

[](#bankingwithdrawaloptions)

`BankingWithdrawalOptions` is used by banking service for providing request parameters.

**Variable Name****Type****Description**bankAccountIdint?Gets or sets target bank account id which money will be transferred to when withdrawal is completed.It will be obtained as a result of the request to list bank accounts.amountfloatGets or sets withdrawal amount### Service Method

[](#service-method-4)

#### Purpose

[](#purpose-4)

Creates a withdrawal request from given bank account for authorized merchant.

**Method****Params****Return Type**WithdrawalBankingWithdrawalOptionsPaparaResult#### Usage

[](#usage-4)

```
  /**
   * Creates a withdrawal request from given bank account for authorized merchant.
   *
   * @param BankingWithdrawalOptions $options
   * @return PaparaResult
   */
  public function Withdrawal()
  {
    $bankAccountResult = $this->client->BankingService->GetBankAccounts();

    $bankAccount = $bankAccountResult->data[0];

    $options = new BankingWithdrawalOptions;
    $options->amount = 10;
    $options->bankAccountId = $bankAccount->bankAccountId;

    $result = $this->client->BankingService->Withdrawal($options);
    return $result;
  }
```

Possible Errors and Error Codes
-------------------------------

[](#possible-errors-and-error-codes)

**Error Code****Error Description**105Insufficient funds.115Requested amount is lower then minimum limit.120Bank account not found.247Merchant's account is not active.Cash Deposit
====================================================

[](#cash-deposit)

With the integration of Papara physical point, you can become a money loading point and earn money from which end users can load balance to their Papara accounts. Physical point integration methods should only be used in scenarios where users load cash to Papara accounts.

Get Cash Deposit Information
----------------------------

[](#get-cash-deposit-information)

Returns cash deposit information. To perform this operation use `getCashDeposit` method on `Cash Deposit` service. `id` should be provided.

### CashDeposit Model

[](#cashdeposit-model)

`CashDeposit` is used by cash deposit service to match returning cash deposit values from API

**Variable Name****Type****Description**MerchantReferencestringReturns merchant reference codeIdint?Returns cash deposit IDCreatedAtDateTime?Returns created date of cash depositAmountfloatReturns amount of cash depositCurrencyint?Returns currency of cash depositFeefloatReturns fee of cash depositResultingBalancefloatReturns resulting balance in merchant's accountDescriptionstringReturns description### CashDepositGetOptions

[](#cashdepositgetoptions)

`CashDepositGetOptions` is used by cash deposit service for providing request parameters

**Variable Name****Type****Description**idintGets or sets cash deposit ID### Service Method

[](#service-method-5)

#### Purpose

[](#purpose-5)

Returns a cash deposit information

**Method****Params****Return Type**getCashDepositCashDepositGetOptionsPaparaResult#### Usage

[](#usage-5)

```
  /**
   * Returns a cash deposit information.
   *
   * @param CashDepositGetOptions $options
   * @return PaparaResult
   */
  public function getCashDeposit()
  {
    $cashDepositGetOptions = new CashDepositGetOptions;
    $cashDepositGetOptions->id = $result->data->id;

    $cashDepositResult = $this->client->CashDepositService->getCashDeposit($cashDepositGetOptions);
    return $result;
  }
```

Get Cash Deposit By Reference
-----------------------------

[](#get-cash-deposit-by-reference)

Returns the information of the money loading process from the physical point with the merchant reference information. To perform this operation use `getByReference` method on `Cash Deposit` service. `reference` should be provided.

### CashDepositByReferenceOptions

[](#cashdepositbyreferenceoptions)

`CashDepositByReferenceOptions` is used by cash deposit service for providing request parameters.

**Variable Name****Type****Description**referencestringGets or sets cash deposit reference no. Reference no is required.### Service Method

[](#service-method-6)

#### Purpose

[](#purpose-6)

Returns a cash deposit object using merchant's unique reference number.

**Method****Params****Return Type**getByReferenceCashDepositByReferenceOptionsPaparaResult#### Usage

[](#usage-6)

```
  /**
   * Returns a cash deposit object using merchant's unique reference number.
   *
   * @param CashDepositByReferenceOptions $options
   * @return PaparaResult
   */
  public function getByReference()
  {
    $cashDepositByReferenceOptions = new CashDepositByReferenceOptions;
    $cashDepositByReferenceOptions->reference = "REFERENCE_NO";

    $result = $this->client->CashDepositService->getByReference($cashDepositByReferenceOptions);
    return $result;
  }
```

Create Cash Deposit With Phone Number
-------------------------------------

[](#create-cash-deposit-with-phone-number)

It deposits money to the user from the physical point. using user’s phone number. To perform this operation use `createWithPhoneNumber` method on `Cash Deposit` service. `phoneNumber`, `amount` and `merchantReference` should be provided.

### CashDepositToPhoneOptions

[](#cashdeposittophoneoptions)

`CashDepositToPhoneOptions` is used by cash deposit service for providing request parameters.

**Variable Name****Type****Description**phoneNumberstringGets or sets phone number. The mobile phone number registered in the Papara account of the user to be loaded with cash.amountfloatGets or sets amount. The amount of the cash deposit. This amount will be transferred to the account of the user who received the payment. The amount to be deducted from the merchant account will be exactly this number.merchantReferencestringGets or sets merchant reference. The unique value sent by the merchant to prevent false repetitions in cash loading transactions. If a previously submitted and successful merchantReference is resubmitted with a new request, the request will fail. MerchantReference sent with failed requests can be resubmitted.### Service Method

[](#service-method-7)

#### Purpose

[](#purpose-7)

Creates a cash deposit request using end users's phone number.

**Method****Params****Return Type**createWithPhoneNumberCashDepositToPhoneOptionsPaparaResult#### Usage

[](#usage-7)

```
  /**
   * Creates a cash deposit request using end users's phone number.
   *
   * @param CashDepositToPhoneOptions $options
   * @return PaparaResult
   */
  public function createWithPhoneNumber()
  {
    $cashDepositToPhoneOptions = new CashDepositToPhoneOptions;
    $cashDepositToPhoneOptions->amount = 10;
    $cashDepositToPhoneOptions->merchantReference = uniqid();
    $cashDepositToPhoneOptions->phoneNumber = $this->config['PersonalPhoneNumber'];

    $result = $this->client->CashDepositService->createWithPhoneNumber($cashDepositToPhoneOptions);
    return $result;
  }
```

Create Cash Deposit With Account Number
---------------------------------------

[](#create-cash-deposit-with-account-number)

Deposits money to the user with Papara number from the physical point. To perform this operation use `createWithAccountNumber` on `Cash Deposit` service. `accountNumber`, `amount` and `merchantReference` should be provided.

### CashDepositToAccountNumberOptions

[](#cashdeposittoaccountnumberoptions)

`CashDepositToAccountNumberOptions` is used by cash deposit service for providing request parameters.

**Variable Name****Type****Description**accountNumberintGets or sets account number. Papara account number of the user who will be loaded with cash.amountfloatGets or sets amount. The amount of the cash deposit. This amount will be transferred to the account of the user who received the payment. The amount to be deducted from the merchant account will be exactly this number.merchantReferencestringGets or sets merchant reference. The unique value sent by the merchant to prevent false repetitions in cash loading transactions. If a previously submitted and successful merchantReference is resubmitted with a new request, the request will fail. MerchantReference sent with failed requests can be resubmitted.### Service Method

[](#service-method-8)

#### Purpose

[](#purpose-8)

Creates a cash deposit request using end user's account number.

**Method****Params****Return Type**createWithAccountNumberCashDepositToAccountNumberOptionsPaparaResult#### Usage

[](#usage-8)

```
  /**
   * Creates a cash deposit request using end user's account number.
   *
   * @param CashDepositToAccountNumberOptions $options
   * @return PaparaResult
   */
  public function createWithAccountNumber()
  {
    $cashDepositToAccountNumberOptions = new CashDepositToAccountNumberOptions;
    $cashDepositToAccountNumberOptions->amount = 10;
    $cashDepositToAccountNumberOptions->merchantReference = uniqid();
    $cashDepositToAccountNumberOptions->accountNumber = $this->config['PersonalAccountNumber'];

    $result = $this->client->CashDepositService->createWithAccountNumber($cashDepositToAccountNumberOptions);
    return $result;
  }
```

Create Cash Deposit With National Identity Number
-------------------------------------------------

[](#create-cash-deposit-with-national-identity-number)

Deposits money to the user with national identity number registered in Papara from the physical point. To perform this operation use `createWithTckn` on `Cash Deposit` service. `tckn`, `amount` and `merchantReference` should be provided.

### CashDepositToTcknOptions

[](#cashdeposittotcknoptions)

`CashDepositToTcknOptions` is used by cash deposit service for providing request parameters.

**Variable Name****Type****Description**tcknlongGets or sets national identity number which is linked to user's Papara accountamountfloatGets or sets amount. The amount of the cash deposit. This amount will be transferred to the account of the user who received the payment. The amount to be deducted from the merchant account will be exactly this numbermerchantReferencestringGets or sets merchant reference. The unique value sent by the merchant to prevent false repetitions in cash loading transactions. If a previously submitted and successful merchantReference is resubmitted with a new request, the request will fail. MerchantReference sent with failed requests can be resubmitted### Service Method

[](#service-method-9)

#### Purpose

[](#purpose-9)

Creates a cash deposit request using end users's national identity number.

**Method****Params****Return Type**createWithTcknCashDepositToTcknOptionsPaparaResult#### Usage

[](#usage-9)

```
  /**
   * Creates a cash deposit request using end users's national identity number.
   *
   * @param CashDepositToTcknOptions $options
   * @return PaparaResult
   */
  public function createWithTckn()
  {
    $cashDepositToTcknOptions = new CashDepositToTcknOptions;
    $cashDepositToTcknOptions->amount = 10;
    $cashDepositToTcknOptions->merchantReference = uniqid();
    $cashDepositToTcknOptions->tckn = $this->config['TCKN'];

    $result = $this->client->CashDepositService->createWithTckn($cashDepositToTcknOptions);
    return $result;
  }
```

Create Cash Deposit Provision Control With National Identity Number
-------------------------------------------------------------------

[](#create-cash-deposit-provision-control-with-national-identity-number)

Creates a request to deposit money from the physical point using national identity number registered in Papara without provision. To perform this operation use `createProvisionWithTcknControl` on `Cash Deposit` service. `phoneNumber`, `tckn`, `amount` and `merchantReference` should be provided.

### CashDepositProvision Model

[](#cashdepositprovision-model)

`CashDepositProvision` is used by cash deposit service to match returning cash deposit provision values from API.

**Variable Name****Type****Description**IdintReturns cash deposit IDCreatedAtDateTimeReturns created date of cash depositAmountfloatAmountCurrencyintCurrencyMerchantReferencestringReturns merchant reference codeUserFullNamestringReturns end user's full name### CashDepositTcknControlOptions

[](#cashdeposittckncontroloptions)

`CashDepositTcknControlOptions` is used by cash deposit service for providing request parameters.

**Variable Name****Type****Description**phoneNumberstringGets or sets user's phone number. The phone number of the user to be sent money, including the country code and "+".tcknintGets or sets national identity number which is linked to user's Papara accountamountfloatGets or sets amount. The amount of the cash deposit. This amount will be transferred to the account of the user who received the payment. The amount to be deducted from the merchant account will be exactly this number.merchantReferencestringGets or sets merchant reference. The unique value sent by the merchant to prevent false repetitions in cash loading transactions. If a previously submitted and successful merchantReference is resubmitted with a new request, the request will fail. MerchantReference sent with failed requests can be resubmitted.### Service Method

[](#service-method-10)

#### Purpose

[](#purpose-10)

Creates a cash deposit request without upfront payment using end user's national identity number.

**Method****Params****Return Type**createProvisionWithTcknControlCashDepositTcknControlOptionsPaparaResult#### Usage

[](#usage-10)

```
  /**
   * Creates a cash deposit request without upfront payment using end user's national identity number.
   *
   * @param CashDepositTcknControlOptions $options
   * @return PaparaResult
   */
  public function createProvisionWithTcknControl()
  {
    $cashDepositTcknControlOptions = new CashDepositTcknControlOptions;
    $cashDepositTcknControlOptions->amount = 10;
    $cashDepositTcknControlOptions->merchantReference = uniqid();
    $cashDepositTcknControlOptions->phoneNumber = $this->config['PersonalPhoneNumber'];
    $cashDepositTcknControlOptions->tckn = $this->config['TCKN'];

    $result = $this->client->CashDepositService->createProvisionWithTcknControl($cashDepositTcknControlOptions);
    return $result;
  }
```

Create Cash Deposit Provision With National Identity Number
-----------------------------------------------------------

[](#create-cash-deposit-provision-with-national-identity-number)

Creates a request to deposit money from the physical point using national identity number registered in Papara without provision. To perform this operation use `createProvisionWithTckn` on `Cash Deposit` service. `phoneNumber`, `tckn`, `amount` and `merchantReference` should be provided.

### CashDepositProvision Model

[](#cashdepositprovision-model-1)

`CashDepositProvision` is used by cash deposit service to match returning cash deposit provision values from API.

**Variable Name****Type****Description**IdintReturns cash deposit IDCreatedAtDateTimeReturns created date of cash depositAmountfloatAmountCurrencyintCurrencyMerchantReferencestringReturns merchant reference codeUserFullNamestringReturns end user's full name### CashDepositTcknControlOptions

[](#cashdeposittckncontroloptions-1)

`CashDepositTcknControlOptions` is used by cash deposit service for providing request parameters.

**Variable Name****Type****Description**phoneNumberstringGets or sets user's phone number. The phone number of the user to be sent money, including the country code and "+".tcknintGets or sets national identity number which is linked to user's Papara accountamountfloatGets or sets amount. The amount of the cash deposit. This amount will be transferred to the account of the user who received the payment. The amount to be deducted from the merchant account will be exactly this number.merchantReferencestringGets or sets merchant reference. The unique value sent by the merchant to prevent false repetitions in cash loading transactions. If a previously submitted and successful merchantReference is resubmitted with a new request, the request will fail. MerchantReference sent with failed requests can be resubmitted.### Service Method

[](#service-method-11)

#### Purpose

[](#purpose-11)

Creates a cash deposit request without upfront payment using end user's national identity number.

**Method****Params****Return Type**createProvisionWithTcknCashDepositTcknControlOptionsPaparaResult#### Usage

[](#usage-11)

```
  /**
   * Creates a cash deposit request without upfront payment using end user's national identity number.
   *
   * @param CashDepositTcknControlOptions $options
   * @return PaparaResult
   */
  public function createProvisionWithTckn()
  {
    $cashDepositTcknControlOptions = new CashDepositTcknControlOptions;
    $cashDepositTcknControlOptions->amount = 10;
    $cashDepositTcknControlOptions->merchantReference = uniqid();
    $cashDepositTcknControlOptions->phoneNumber = $this->config['PersonalPhoneNumber'];
    $cashDepositTcknControlOptions->tckn = $this->config['TCKN'];

    $result = $this->client->CashDepositService->createProvisionWithTckn($cashDepositTcknControlOptions);
    return $result;
  }
```

Create Cash Deposit Provision With Phone Number
-----------------------------------------------

[](#create-cash-deposit-provision-with-phone-number)

Creates a request to deposit money from the physical point using phone number registered in Papara without provision. To perform this operation use `createProvisionWithPhoneNumber` on `Cash Deposit` service. `phoneNumber`, `amount` and `merchantReference` should be provided.

### Service Method

[](#service-method-12)

#### Purpose

[](#purpose-12)

Creates a cash deposit request without upfront payment using end users's phone number.

**Method****Params****Return Type**CreateProvisionWithPhoneNumberCashDepositToPhoneOptionsPaparaResult#### Usage

[](#usage-12)

```
  /**
   * Creates a cash deposit request without upfront payment using end users's phone number.
   *
   * @param CashDepositToPhoneOptions $options
   * @return PaparaResult
   */
  public function createProvisionWithPhoneNumber()
  {
    $cashDepositToPhoneOptions = new CashDepositToPhoneOptions;
    $cashDepositToPhoneOptions->amount = 10;
    $cashDepositToPhoneOptions->merchantReference = uniqid();
    $cashDepositToPhoneOptions->phoneNumber = $this->config['PersonalPhoneNumber'];

    $result = $this->client->CashDepositService->createProvisionWithPhoneNumber($cashDepositToPhoneOptions);
    return $result;
  }
```

Create Cash Deposit Provision With Account Number
-------------------------------------------------

[](#create-cash-deposit-provision-with-account-number)

Creates a request to deposit money from the physical point using Papara number without provision. To perform this operation use `createProvisionWithAccountNumber` on `Cash Deposit` service. `accountNumber`, `amount` and `merchantReference` should be provided.

### Service Method

[](#service-method-13)

#### Purpose

[](#purpose-13)

Creates a cash deposit request without upfront payment using end users's phone number.

**Method****Params****Return Type**createProvisionWithAccountNumberCashDepositToAccountNumberOptionsPaparaResult#### Usage

[](#usage-13)

```
  /**
   * Creates a cash deposit request without upfront payment using merchant's account number.
   *
   * @param CashDepositToAccountNumberOptions $options
   * @return PaparaResult
   */
  public function createProvisionWithAccountNumber()
  {
    $cashDepositToAccountNumberOptions = new CashDepositToAccountNumberOptions;
    $cashDepositToAccountNumberOptions->amount = 10;
    $cashDepositToAccountNumberOptions->merchantReference = uniqid();
    $cashDepositToAccountNumberOptions->accountNumber = $this->config['PersonalAccountNumber'];

    $result = $this->client->CashDepositService->createProvisionWithAccountNumber($cashDepositToAccountNumberOptions);

    return $result;
  }
```

Cash Deposit Provision Control By Reference Code
------------------------------------------------

[](#cash-deposit-provision-control-by-reference-code)

With the reference code created by the user, it checks the deposit request without prepayment from the physical point and makes it ready to be approved. To perform this operation, use `controlProvisionByReference` on `Cash Deposit` service. `referenceCode` and `amount` should be provided.

### Service Method

[](#service-method-14)

#### Purpose

[](#purpose-14)

Makes a cash deposit request ready to be completed without upfront payment.

**Method****Params****Return Type**controlProvisionByReferenceCashDepositControlOptionsPaparaResult#### Usage

[](#usage-14)

```
  /**
   * Makes a cash deposit ready to be complete
   *
   * @param CashDepositControlOptions $options
   * @return PaparaResult
   */
  public function controlProvisionByReference()
  {
    $options = new CashDepositControlOptions;
    $options->amount = 10;
    $options->referenceCode = $result->data->merchantReference;

    $cashdeposit = $this->client->CashDepositService->controlProvisionByReference($options);

    return $result;
  }
```

Complete Cash Deposit Provision By Reference Code
-------------------------------------------------

[](#complete-cash-deposit-provision-by-reference-code)

With the reference code created by the user, it approves the deposit request without prepayment from the physical point and transfers the balance to the user. To perform this operation, use `completeProvisionByReference` on `Cash Deposit` service. `referenceCode` and `amount` should be provided.

### Service Method

[](#service-method-15)

#### Purpose

[](#purpose-15)

Completes a cash deposit request without upfront payment.

**Method****Params****Return Type**completeProvisionByReferenceCashDepositControlOptionsPaparaResult#### Usage

[](#usage-15)

```
  /**
   * Completes a cash deposit request without upfront payment
   *
   * @param CashDepositControlOptions $options
   * @return PaparaResult
   */
  public function completeProvisionByReference()
  {
    $options = new CashDepositControlOptions;
    $options->amount = 10;
    $options->referenceCode = $result->data->merchantReference;

    $cashdeposit = $this->client->CashDepositService->completeProvisionByReference($options);

    return $result;
  }
```

Cash Deposit Completion
-----------------------

[](#cash-deposit-completion)

Confirms the deposit request created from the physical point to the user without prepayment. To perform this operation, use `completeProvision` on `Cash Deposit` service. `id` and `transactionDate` should be provided.

### CashDepositCompleteOptions

[](#cashdepositcompleteoptions)

`CashDepositCompleteOptions` is used by cash deposit service for providing request parameters.

**Variable Name****Type****Description**idintGets or sets ID of cash deposit requesttransactionDateDateTimeGets or sets date of cash deposit transaction### Service Method

[](#service-method-16)

#### Purpose

[](#purpose-16)

Completes a cash deposit request without upfront payment.

**Method****Params****Return Type**completeProvisionCashDepositCompleteOptionsPaparaResult#### Usage

[](#usage-16)

```
  /**
   * Completes a cash deposit request without upfront payment.
   *
   * @param CashDepositCompleteOptions $options
   * @return PaparaResult
   */
  public function completeProvision()
  {
    $cashDepositCompleteOptions = new CashDepositCompleteOptions;
    $cashDepositCompleteOptions->id = $result->data->id;
    $cashDepositCompleteOptions->transactionDate = $result->data->createdAt;

    $compilationResult = $this->client->CashDepositService->completeProvision($cashDepositCompleteOptions);
    return $result;
  }
```

Get Cash Deposit By Date
------------------------

[](#get-cash-deposit-by-date)

Retrieves information of money deposits from the physical point. To perform this operation, use `getCashDepositByDate` on `Cash Deposit` service. `startDate`, `endDate`, `pageIndex` and `pageItemCount` should be provided.

### CashDepositByDateOptions

[](#cashdepositbydateoptions)

`CashDepositByDateOptions` is used by cash deposit service for providing request parameters.

**Variable Name****Type****Description**startDateDateTimeGets or sets start date of cash depositendDateDateTimeGets or sets end date of cash depositpageIndexintGets or sets page index. It is the index number of the page that is wanted to display from the pages calculated on the basis of the number of records (pageItemCount) desired to be displayed on a page. Note: the first page is always 1pageItemCountintGets or sets page item count. The number of records that are desired to be displayed on a page### Service Method

[](#service-method-17)

#### Purpose

[](#purpose-17)

Returns a cash deposit information by given date.

**Method****Params****Return Type**getCashDepositByDateCashDepositByDateOptionsPaparaResult#### Usage

[](#usage-17)

```
  /**
   * Returns a cash deposit information by given date.
   *
   * @param CashDepositByDateOptions $options
   * @return PaparaResult
   */
  public function getCashDepositByDate()
  {
    $startDate = new DateTime('2020-01-01');
    $endDate = new DateTime('2020-09-01');

    $cashDepositByDateOptions = new CashDepositByDateOptions;
    $cashDepositByDateOptions->startDate = $startDate->format('c');
    $cashDepositByDateOptions->endDate = $endDate->format('c');
    $cashDepositByDateOptions->pageIndex = 1;
    $cashDepositByDateOptions->pageItemCount = 20;

    $result = $this->client->CashDepositService->getCashDepositByDate($cashDepositByDateOptions);
    return $result;
  }
```

Settlements
-----------

[](#settlements)

Returns the total number and volume of transactions performed within the given dates. Both start and end dates are included in the calculation. To perform this operation, use `settlements` on `Cash Deposit` service. `startDate` and `endDate` should be provided.

### CashDepositSettlementOptions

[](#cashdepositsettlementoptions)

`CashDepositSettlementOptions` is used by cash deposit service for providing request parameters.

**Variable Name****Type****Description**startDateDateTimeGets or sets start date for settlementendDateDateTimeGets or sets end date for settlemententryTypeEntryType?Gets or sets entry type for settlement### Service Method

[](#service-method-18)

#### Purpose

[](#purpose-18)

Returns total transaction volume and count between given dates. Start and end dates are included.

**Method****Params****Return Type**settlementsCashDepositSettlementOptionsPaparaResult#### Usage

[](#usage-18)

```
  /**
   * Returns total transaction volume and count between given dates. Start and end dates are included.
   *
   * @param CashDepositSettlementOptions $options
   * @return PaparaResult
   */
  public function provisionSettlements()
  {
    $startDate = new DateTime('2020-01-01');
    $endDate = new DateTime('2020-09-01');

    $cashDepositSettlementOptions = new CashDepositSettlementOptions;
    $cashDepositSettlementOptions->startDate = $startDate->format('c');
    $cashDepositSettlementOptions->endDate = $endDate->format('c');
    $cashDepositSettlementOptions->entryType = 1;

    $result = $this->client->CashDepositService->settlements($cashDepositSettlementOptions);
    return $result;
  }
```

Provision Settlements
---------------------

[](#provision-settlements)

Returns the total number and volume of transactions performed within the given dates. Both start and end dates are included in the calculation. To perform this operation, use `provisionSettlements` on `Cash Deposit` service. `startDate` and `endDate` should be provided.

### CashDepositSettlementOptions

[](#cashdepositsettlementoptions-1)

`CashDepositSettlementOptions` is used by cash deposit service for providing request parameters.

**Variable Name****Type****Description**startDateDateTimeGets or sets start date for settlementendDateDateTimeGets or sets end date for settlemententryTypeEntryType?Gets or sets entry type for settlement### Service Method

[](#service-method-19)

#### Purpose

[](#purpose-19)

Returns total transaction volume and count between given dates. Start and end dates are included.

**Method****Params****Return Type**provisionSettlementsCashDepositSettlementOptionsPaparaResult#### Usage

[](#usage-19)

```
  /**
   * Returns total transaction volume and count between given dates. Start and end dates are included.
   *
   * @param CashDepositSettlementOptions $options
   * @return PaparaResult
   */
  public function provisionSettlements()
  {
    $startDate = new DateTime('2020-01-01');
    $endDate = new DateTime('2020-09-01');

    $cashDepositSettlementOptions = new CashDepositSettlementOptions;
    $cashDepositSettlementOptions->startDate = $startDate->format('c');
    $cashDepositSettlementOptions->endDate = $endDate->format('c');
    $cashDepositSettlementOptions->entryType = 1;

    $result = $this->client->CashDepositService->provisionSettlements($cashDepositSettlementOptions);
    return $result;
  }
```

Possible Errors and Error Codes
-------------------------------

[](#possible-errors-and-error-codes-1)

**Error Code****Error Description**100User not found.101Merchant information could not found.105Insufficient funds.107The user exceeds the balance limit with this transaction.111The user exceeds the monthly transaction limit with this transaction112An amount has been sent below the minimum deposit limit.203The user account is blocked.997The authorization to make a cash deposit is not defined in your account. You should contact your customer representative.998The parameters you submitted are not in the expected format. Example: one of the mandatory fields is not provided.999An error occurred in the Papara system.Mass Payment
====================================================

[](#mass-payment)

This part is the technical integration statement prepared for merchants those want to distribute payments to their users quickly, safely and widely through Papara.

Get Mass Payment
----------------

[](#get-mass-payment)

Returns information about the payment distribution process. To perform this operation use `getMassPayment` method on `MassPayment` service. `id` should be provided.

### Mass Payment Model

[](#mass-payment-model)

`MassPayment` is used by mass payment service to match returning mass payment values from API.

**Variable Name****Type****Description**massPaymentIdstringReturns mass payment IDidint?Returns ID which is created after payment is donecreatedAtDateTimeReturns created dateamountfloatReturns amount of paymentcurrencyint?Returns currency. Values are “0”, “1”, “2”, “3”feefloatReturns feeresultingBalancefloatReturns resulting balancedescriptionstringReturns description### MassPaymentGetOptions

[](#masspaymentgetoptions)

`MassPaymentGetOptions` is used by mass payment service for providing request parameters.

**Variable Name****Type****Description**idlongGets or sets mass payment ID### Service Method

[](#service-method-20)

#### Purpose

[](#purpose-20)

Returns mass payment information for authorized merchant.

**Method****Params****Return Type**getMassPaymentMassPaymentGetOptionsPaparaResult#### Usage

[](#usage-20)

```
  /**
   * Returns mass payment information for authorized merchant.
   *
   * @param MassPaymentGetOptions $options
   * @return PaparaResult
   */
  public function getMassPayment()
  {
    $getMassPaymentGetOptions = new MassPaymentGetOptions;
    $getMassPaymentGetOptions->id = "MASS_PAYMENT_ID";

    $result = $this->client->MassPaymentService->getMassPayment($getMassPaymentGetOptions);
    return $result;
  }
```

Get Mass Payment By Mass Payment Reference Number
-------------------------------------------------

[](#get-mass-payment-by-mass-payment-reference-number)

Returns mass payment using mass payment reference number To perform this operation use `getMassPaymentByReference` method on `MassPayment` service. `reference` should be provided.

### Mass Payment Model

[](#mass-payment-model-1)

`MassPayment` is used by mass payment service to match returning mass payment values from API.

### MassPaymentByReferenceOptions

[](#masspaymentbyreferenceoptions)

`MassPaymentByReferenceOptions` is used by mass payment service for providing request parameters.

**Variable Name****Type****Description**referencestringGets or sets mass payment ID### Service Method

[](#service-method-21)

#### Purpose

[](#purpose-21)

Returns mass payment information for authorized merchant.

**Method****Params****Return Type**getMassPaymentByReferenceMassPaymentByReferenceOptionsPaparaResult#### Usage

[](#usage-21)

```
  /**
   * Returns mass payment information for authorized merchant.
   *
   * @param MassPaymentGetOptions $options
   * @return PaparaResult
   */
  public function getMassPaymentByReference()
  {
    $getMassPaymentByReferenceOptions = new MassPaymentByReferenceOptions;
    $getMassPaymentByReferenceOptions->reference = "MASS_PAYMENT_REFERENCE";

    $result = $this->client->MassPaymentService->getMassPaymentByReference($getMassPaymentByReferenceOptions);
    return $result;
  }
```

Create Mass Payment To Account Number
-------------------------------------

[](#create-mass-payment-to-account-number)

Send money to Papara number. To perform this operation use `createMassPaymentWithAccountNumber` method on `MassPayment` service. `accountNumber`, `amount` and `massPaymentId` should be provided.

### MassPaymentToPaparaNumberOptions

[](#masspaymenttopaparanumberoptions)

`MassPaymentToPaparaNumberOptions` is used by mass payment service for providing request parameters.

**Variable Name****Type****Description**accountNumberstringGets or sets Papara account number. The 10-digit Papara number of the user who will receive the payment. It can be in the format 1234567890 or PL1234567890. Before the Papara version transition, the Papara number was called the wallet number.Old wallet numbers have been changed to Papara number. Payment can be distributed to old wallet numbers.parseAccountNumberint?Gets or sets parse account number. Parses the account number to long type. In old papara integrations, account / wallet number was made by starting with PL. The service was written in such a way that it accepts numbers starting with PL, in order not to cause problems to the member merchants that receive the papara number from their users.amountfloatGets or sets amount. The amount of the payment transaction. This amount will be transferred to the account of the user who received the payment. This figure plus transaction fee will be charged to the merchant account.massPaymentIdstringGets or sets mass payment ID. Unique value sent by merchant to prevent erroneous repetition in payment transactions. If a massPaymentId that was sent previously and succeeded is sent again with a new request, the request will fail.turkishNationalIdlongGets or sets national identity number.It provides the control of the identity information sent by the user who will receive the payment, in the Papara system. In case of a conflict of credentials, the transaction will not take place.descriptionstringGets or sets description. Description of the transaction provided by the merchant. It is not a required field. If sent, the customer sees in the transaction descriptions.currencyintGets or sets currency. Values are “0”, “1”, “2”, “3”### Service Method

[](#service-method-22)

#### Purpose

[](#purpose-22)

Creates a mass payment to given account number for authorized merchant.

**Method****Params****Return Type**createMassPaymentWithAccountNumberMassPaymentToPaparaNumberOptionsPaparaResult#### Usage

[](#usage-22)

```
  /**
   * Creates a mass payment to given account number for authorized merchant.
   *
   * @param MassPaymentToPaparaNumberOptions $options
   * @return PaparaResult
   */
  public function createMassPaymentWithAccountNumber()
  {
    $massPaymentToPaparaNumberOptions = new MassPaymentToPaparaNumberOptions;
    $massPaymentToPaparaNumberOptions->accountNumber= $this->config['PersonalAccountNumber'];
    $massPaymentToPaparaNumberOptions->amount= 1;
    $massPaymentToPaparaNumberOptions->description= 'Php Unit Test: MassPaymentToPaparaNumber';
    $massPaymentToPaparaNumberOptions->massPaymentId= uniqid();
    $massPaymentToPaparaNumberOptions->parseAccountNumber= 1;
    $massPaymentToPaparaNumberOptions->turkishNationalId= $this->config['TCKN'];

    $result = $this->client->MassPaymentService->createMassPaymentWithAccountNumber($massPaymentToPaparaNumberOptions);
    return $result;
  }
```

Create Mass Payment To E-Mail Address
-------------------------------------

[](#create-mass-payment-to-e-mail-address)

Send money to e-mail address registered in Papara. To perform this operation use `createMassPaymentWithEmail` method on `MassPayment` service. `email`, `amount` and `massPaymentId` should be provided.

### MassPaymentToEmailOptions

[](#masspaymenttoemailoptions)

`MassPaymentToEmailOptions` is used by mass payment service for providing request parameters.

**Variable Name****Type****Description**emailstringGets or sets e-mail address. Registered email address of the user receiving the payment.amountfloatGets or sets amount. The amount of the payment transaction. This amount will be transferred to the account of the user who received the payment. This figure plus transaction fee will be charged to the merchant account.massPaymentIdstringGets or setsmass payment ID. Unique value sent by merchant to prevent erroneous repetition in payment transactions. If a massPaymentId that was sent previously and succeeded is sent again with a new request, the request will fail.turkishNationalIdlongGets or setsnational identity number.It provides the control of the identity information sent by the user who will receive the payment, in the Papara system. In case of a conflict of credentials, the transaction will not take place.descriptionstringGets or sets description. Description of the transaction provided by the merchant. It is not a required field. If sent, the customer sees in the transaction descriptions.currencyintGets or sets currency. Values are “0”, “1”, “2”, “3”### Service Method

[](#service-method-23)

#### Purpose

[](#purpose-23)

Creates a mass payment to given e-mail address for authorized merchant.

**Method****Params****Return Type**createMassPaymentWithEmailMassPaymentToEmailOptionsPaparaResult#### Usage

[](#usage-23)

```
  /**
   * Creates a mass payment to given e-mail address for authorized merchant.
   *
   * @param MassPaymentToEmailOptions $options
   * @return void
   */
  public function createMassPaymentWithEmail()
  {
    $massPaymentToEmailOptions = new MassPaymentToEmailOptions;
    $massPaymentToEmailOptions->amount = 1;
    $massPaymentToEmailOptions->description = 'Php Unit Test: MassPaymentToEmail';
    $massPaymentToEmailOptions->massPaymentId = uniqid();
    $massPaymentToEmailOptions->email = $this->config['PersonalEmail'];
    $massPaymentToEmailOptions->turkishNationalId = $this->config['TCKN'];

    $result = $this->client->MassPaymentService->createMassPaymentWithEmail($massPaymentToEmailOptions);
    return $result;
  }
```

Create Mass Payment To Phone Number
-----------------------------------

[](#create-mass-payment-to-phone-number)

Send money to phone number registered in Papara. To perform this operation use `createMassPaymentWithPhoneNumber` method on `MassPayment` service. `phoneNumber`, `amount` and `massPaymentId` should be provided.

### MassPaymentToPhoneNumberOptions

[](#masspaymenttophonenumberoptions)

`MassPaymentToPhoneNumberOptions` is used by mass payment service for providing request parameters.

**Variable Name****Type****Description**phoneNumberstringGets or sets user's phone number. The mobile number of the user who will receive the payment, registered in Papara. It should contain a country code and start with +amountfloatGets or sets amount. The amount of the payment transaction. This amount will be transferred to the account of the user who received the payment. This figure plus transaction fee will be charged to the merchant accountmassPaymentIdstringGets or sets mass payment ID. Unique value sent by merchant to prevent erroneous repetition in payment transactions. If a MassPaymentId that was sent previously and succeeded is sent again with a new request, the request will failturkishNationalIdlongGets or sets national identity number.It provides the control of the identity information sent by the user who will receive the payment, in the Papara system. In case of a conflict of credentials, the transaction will not take placedescriptionstringGets or sets description. Description of the transaction provided by the merchant. It is not a required field. If sent, the customer sees in the transaction descriptionscurrencyintGets or sets currency. Values are “0”, “1”, “2”, “3”### Service Method

[](#service-method-24)

#### Purpose

[](#purpose-24)

Creates a mass payment to given phone number for authorized merchant.

**Method****Params****Return Type**createMassPaymentWithPhoneNumberMassPaymentToPhoneNumberOptionsPaparaResult#### Usage

[](#usage-24)

```
  /**
   * Creates a mass payment to given phone number for authorized merchant.
   *
   * @param MassPaymentToPhoneNumberOptions $options
   * @return void
   */
  public function createMassPaymentWithPhoneNumber()
  {
    $massPaymentToPhoneNumberOptions = new MassPaymentToPhoneNumberOptions;
    $massPaymentToPhoneNumberOptions->amount = 1;
    $massPaymentToPhoneNumberOptions->description = 'Php Unit Test: MassPaymentToEmail';
    $massPaymentToPhoneNumberOptions->massPaymentId = uniqid();
    $massPaymentToPhoneNumberOptions->phoneNumber = $this->config['PersonalPhoneNumber'];
    $massPaymentToPhoneNumberOptions->turkishNationalId = $this->config['TCKN'];

    $result = $this->client->MassPaymentService->createMassPaymentWithPhoneNumber($massPaymentToPhoneNumberOptions);
    return $result;
  }
```

Possible Errors and Error Codes
-------------------------------

[](#possible-errors-and-error-codes-2)

**Error Code****Error Description**100User not found.105Insufficient funds107Receiver exceeds balance limit. The highest possible balance for simple accounts is 750 TL.111Receiver exceeds monthly transaction limit. Simple accounts can receive payments from a total of 2000 TL of defined resources per month.133MassPaymentID was used recently.398The transaction could not be performed because the user you want to send foreign currency to does not have a verified account.997You are not authorized to distribute payments. You can contact your customer representative and request a payment distribution definition to your merchant account.998The parameters you submitted are not in the expected format. Example: Customer number less than 10 digits. In this case, the error message contains details of the format error.999An error occurred in the Papara system.Recurring Mass Payment
========================================================================

[](#recurring-mass-payment)

This section is the technical integration document prepared for the merchants who want to distribute payments to their users in a fast, secure and widespread through Papara.

Recurring Mass Payment Model
----------------------------

[](#recurring-mass-payment-model)

`RecurringMassPayment` class is used by recurring mass payment service to match returning recurring mass payment values from API.

**Variable Name****Type****Description**MerchantIdstringGets or sets merchant id.UserIdstringGets or sets user id.PeriodintGets or sets period. Values are "0" (Monthly), "1" (Weekly), "2" (Daily).ExecutionDayintGets or sets ...th day of period. (Weeks start with Monday).AccountNumberintGets or sets account number.MessagestringGets or sets message.AmountdecimalGets or sets amount.CurrencyCurrencyGets or sets currency.Values are “0” (TRY), “1” (USD), “2” (EUR), “3” (GBP).Create Recurring Mass Payment To Account Number
-----------------------------------------------

[](#create-recurring-mass-payment-to-account-number)

To perform this operation use `CreateRecurringMassPaymentWithAccountNumber` method on `MassPayment` service. `AccountNumber`, `Amount`, `ExecutionDay`, `Description` and `Period` should be provided.

### RecurringMassPaymentToAccountNumberOptions

[](#recurringmasspaymenttoaccountnumberoptions)

`RecurringMassPaymentToAccountNumberOptions` is used by mass payment service for providing request parameters.

**Variable Name****Type****Description**AccountNumberstringGets or sets Papara account number. The 10-digit Papara number of the user who will receive the payment. It can be in the format 1234567890 or PL1234567890. Before the Papara version transition, the Papara number was called the wallet number.Old wallet numbers have been changed to Papara number. Payment can be distributed to old wallet numbers.AmountdecimalGets or sets amount. The amount of the payment transaction. This amount will be transferred to the account of the user who received the payment. This figure plus transaction fee will be charged to the merchant account.TurkishNationalIdlong?Gets or sets national identity number.It provides the control of the identity information sent by the user who will receive the payment, in the Papara system. In case of a conflict of credentials, the transaction will not take place.CurrencyCurrency?Gets or sets currency.Values are “0” (TRY), “1” (USD), “2” (EUR), “3” (GBP).PeriodintGets or sets period. Values are "0" (Monthly), "1" (Weekly), "2" (Daily).ExecutionDayintGets or sets ...th day of period. (Weeks start with Monday).DescriptionstringGets or sets description. Description of the transaction provided by the merchant. It is not a required field. If sent, the customer sees in the transaction descriptions.### Service Method

[](#service-method-25)

#### Purpose

[](#purpose-25)

Creates a recurring mass payment to given account number for authorized merchant.

**Method****Params****Return Type**createRecurringMassPaymentWithAccountNumberRecurringMassPaymentToPaparaNumberOptionsPaparaResult#### Usage

[](#usage-25)

```
  public function createRecurringMassPaymentWithAccountNumber()
  {
    $recurringMassPaymentToPaparaNumberOptions = new RecurringMassPaymentToPaparaNumberOptions;
    $recurringMassPaymentToPaparaNumberOptions->accountNumber= $this->config['PersonalAccountNumber'];
    $recurringMassPaymentToPaparaNumberOptions->amount= 1;
    $recurringMassPaymentToPaparaNumberOptions->description= 'Php Unit Test: RecurringMassPaymentToPaparaNumber';
    $recurringMassPaymentToPaparaNumberOptions->parseAccountNumber= 1;
    $recurringMassPaymentToPaparaNumberOptions->turkishNationalId= $this->config['TCKN'];
    $recurringMassPaymentToPaparaNumberOptions->period= 0;
    $recurringMassPaymentToPaparaNumberOptions->executionDay= 1;
    $recurringMassPaymentToPaparaNumberOptions->currency= 0;

    $result = $this->client->RecurringMassPaymentService->createRecurringMassPaymentWithAccountNumber($recurringMassPaymentToPaparaNumberOptions);
    return $result;
  }
```

Create Recurring Mass Payment To Email
--------------------------------------

[](#create-recurring-mass-payment-to-email)

To perform this operation use `CreateRecurringMassPaymentWithEmail` method on `MassPayment` service. `Email`, `Amount`, `TurkishNationalId`, `Period`, `Currency`, `ExecutionDay` and `Description` should be provided.

### RecurringMassPaymentToEmailOptions

[](#recurringmasspaymenttoemailoptions)

`RecurringMassPaymentToEmailOptions` is used by mass payment service for providing request parameters.

**Variable Name****Type****Description**EmailstringGets or sets e-mail address. Registered email address of the user receiving the payment.AmountdecimalGets or sets amount. The amount of the payment transaction. This amount will be transferred to the account of the user who received the payment. This figure plus transaction fee will be charged to the merchant account.TurkishNationalIdlong?Gets or sets national identity number.It provides the control of the identity information sent by the user who will receive the payment, in the Papara system. In case of a conflict of credentials, the transaction will not take place.CurrencyCurrencyGets or sets currency.Values are “0” (TRY), “1” (USD), “2” (EUR), “3” (GBP).PeriodintGets or sets period. Values are "0" (Monthly), "1" (Weekly), "2" (Daily).ExecutionDayintGets or sets ...th day of period. (Weeks start with Monday).DescriptionstringGets or sets description. Description of the transaction provided by the merchant. It is not a required field. If sent, the customer sees in the transaction descriptions.### Service Method

[](#service-method-26)

#### Purpose

[](#purpose-26)

Creates a recurring mass payment to given email address for authorized merchant.

**Method****Params****Return Type**createRecurringMassPaymentWithEmailRecurringMassPaymentToEmailOptionsPaparaResult#### Usage

[](#usage-26)

```
public function createRecurringMassPaymentWithEmail()
  {
    $recurrinMassPaymentToEmailOptions = new RecurringMassPaymentToEmailOptions;
    $recurrinMassPaymentToEmailOptions->amount = 1;
    $recurrinMassPaymentToEmailOptions->description = 'Php Unit Test: RecurringMassPaymentToEmail';
    $recurrinMassPaymentToEmailOptions->massPaymentId = uniqid();
    $recurrinMassPaymentToEmailOptions->email = $this->config['PersonalEmail'];
    $recurrinMassPaymentToEmailOptions->turkishNationalId = $this->config['TCKN'];
    $recurrinMassPaymentToEmailOptions->period= 0;
    $recurrinMassPaymentToEmailOptions->executionDay= 1;
    $recurrinMassPaymentToEmailOptions->currency= 0;

    $result = $this->client->RecurringMassPaymentService->createRecurringMassPaymentWithEmail($recurrinMassPaymentToEmailOptions);
    return $result;
  }
```

Create Recurring Mass Payment To Phone Number
---------------------------------------------

[](#create-recurring-mass-payment-to-phone-number)

To perform this operation use `CreateRecurringMassPaymentWithPhoneNumber` method on `MassPayment` service. `PhoneNumber`, `Amount`, `TurkishNationalId`, `Period`, `Currency`, `ExecutionDay` and `Description` should be provided.

### RecurringMassPaymentToPhoneNumberOptions

[](#recurringmasspaymenttophonenumberoptions)

`RecurringMassPaymentToPhoneNumberOptions` is used by mass payment service for providing request parameters.

**Variable Name****Type****Description**PhoneNumberstringGets or sets user's phone number. The mobile number of the user who will receive the payment, registered in Papara. It should contain a country code and start with +AmountdecimalGets or sets amount. The amount of the payment transaction. This amount will be transferred to the account of the user who received the payment. This figure plus transaction fee will be charged to the merchant account.TurkishNationalIdlong?Gets or sets national identity number.It provides the control of the identity information sent by the user who will receive the payment, in the Papara system. In case of a conflict of credentials, the transaction will not take place.CurrencyCurrencyGets or sets currency.Values are “0” (TRY), “1” (USD), “2” (EUR), “3” (GBP).PeriodintGets or sets period. Values are "0" (Monthly), "1" (Weekly), "2" (Daily).ExecutionDayintGets or sets ...th day of period. (Weeks start with Monday).DescriptionstringGets or sets description. Description of the transaction provided by the merchant. It is not a required field. If sent, the customer sees in the transaction descriptions.### Service Method

[](#service-method-27)

#### Purpose

[](#purpose-27)

Creates a recurring mass payment to given phone number for authorized merchant.

**Method****Params****Return Type**createRecurringMassPaymentWithPhoneNumberRecurringMassPaymentToPhoneNumberOptionsPaparaResult#### Usage

[](#usage-27)

```
public function createRecurringMassPaymentWithPhoneNumber()
  {
    $recurringMassPaymentToPhoneNumberOptions = new RecurringMassPaymentToPhoneNumberOptions;
    $recurringMassPaymentToPhoneNumberOptions->amount = 1;
    $recurringMassPaymentToPhoneNumberOptions->description = 'Php Unit Test: RecurringMassPaymentToEmail';
    $recurringMassPaymentToPhoneNumberOptions->massPaymentId = uniqid();
    $recurringMassPaymentToPhoneNumberOptions->phoneNumber = $this->config['PersonalPhoneNumber'];
    $recurringMassPaymentToPhoneNumberOptions->turkishNationalId = $this->config['TCKN'];
    $recurringMassPaymentToPhoneNumberOptions->period= 0;
    $recurringMassPaymentToPhoneNumberOptions->executionDay= 1;
    $recurringMassPaymentToPhoneNumberOptions->currency= 0;

    $result = $this->client->RecurringMassPaymentService->createRecurringMassPaymentWithPhoneNumber($recurringMassPaymentToPhoneNumberOptions);
    return $result;
  }
```

Possible Errors and Error Codes
-------------------------------

[](#possible-errors-and-error-codes-3)

**Error Code****Error Description**100User not found.105Insufficient funds107Receiver exceeds balance limit. The highest possible balance for simple accounts is 750 TL.111Receiver exceeds monthly transaction limit. Simple accounts can receive payments from a total of 2000 TL of defined resources per month.133MassPaymentID was used recently.398The transaction could not be performed because the user you want to send foreign currency to does not have a verified account.997You are not authorized to distribute payments. You can contact your customer representative and request a payment distribution definition to your merchant account.998The parameters you submitted are not in the expected format. Example: Customer number less than 10 digits. In this case, the error message contains details of the format error.999An error occurred in the Papara system.Payments
============================================

[](#payments)

Payment service will be used for getting, creating or listing payments and refunding. Before showing the payment button to users, the merchant must create a payment transaction on Papara. Payment records are time dependent. Transaction records that are not completed and paid by the end user are deleted from Papara system after 1 hour. Completed payment records are never deleted and can always be queried with the API.

Get Payment
-----------

[](#get-payment)

Returns payment information. To perform this operation use `getPayment` method on `Payment` service. `id` should be provided.

### Payment Model

[](#payment-model)

`Payment` is used by payment service to match returning payment values from API.

**Variable Name****Type****Description**merchantAccountReturns merhcantidstringReturns IDCreatedAtDateTimeReturns created datemerchantIdstringReturns merchant IDuserIdstringReturns user IDpaymentMethodintReturns payment Method. 0 - User completed transaction with existing Papara balance 1 - User completed the transaction with a debit / credit card that was previously defined. 2 - User completed transaction via mobile payment.paymentMethodDescriptionstringReturns payment method descriptionreferenceIdstringReturns referance IDorderDescriptionstringReturns order descriptionstatusintReturns status. 0 - Awaiting, payment is not done yet. 1 - Payment is done, transaction is completed. 2 - Transactions is refunded by merchant.statusDescriptionstringReturns status descriptionamountfloatReturns amountfeefloatReturns feecurrencyintReturns currency. Values are “0”, “1”, “2”, “3”notificationUrlstringReturns notification URLnotificationDoneboolReturns if notification was maderedirectUrlstringReturns redirect URLraymentUrlstringReturns payment URLmerchantSecretKeystringReturns merchant secret keyreturningRedirectUrlstringReturns returning Redirect URLturkishNationalIdlongReturns national identity number### PaymentGetOptions

[](#paymentgetoptions)

`PaymentGetOptions` will be used as parameter while acquiring payment information.

**Variable Name****Type****Description**idstringGets or sets unique payment ID### Service Method

[](#service-method-28)

#### Purpose

[](#purpose-28)

Returns payment and balance information for authorized merchant.

**Method****Params****Return Type**getPaymentPaymentGetOptionsPaparaResult#### Usage

[](#usage-28)

```
  /**
   * Returns payment and balance information for authorized merchant.
   *
   * @param PaymentGetOptions $options
   * @return PaparaResult
   */
  public function getPayment()
  {
    $paymentGetOptions = new PaymentGetOptions;
    $paymentGetOptions->id = "PAYMENT_ID";

    $result = $this->client->PaymentService->getPayment($paymentGetOptions);
    return $result;
  }
```

Get Payment By Payment Reference Number
---------------------------------------

[](#get-payment-by-payment-reference-number)

Returns payment information. To perform this operation use `getPayment` method on `getPaymentByReference` service. `referenceId` should be provided.

### PaymentGetByReferenceOptions

[](#paymentgetbyreferenceoptions)

`PaymentGetByReferenceOptions` will be used as parameter while acquiring payment information.

**Variable Name****Type****Description**referenceIdstringGets or sets unique payment reference number### Service Method

[](#service-method-29)

#### Purpose

[](#purpose-29)

Returns payment and balance information for authorized merchant.

**Method****Params****Return Type**getPaymentByReferencePaymentGetByReferenceOptionsPaparaResult#### Usage

[](#usage-29)

```
  /**
   * Returns payment and balance information for authorized merchant.
   *
   * @param PaymentGetOptions $options
   * @return PaparaResult
   */
  public function getPaymentByReference()
  {
    $paymentByReferenceOptions = new PaymentGetByReferenceOptions;
    $paymentByReferenceOptions->referenceId = "PAYMENT_REFERENCE_NUMBER";

    $result = $this->client->PaymentService->getPaymentByReference($paymentByReferenceOptions);
    return $result;
  }
```

Create Payment
--------------

[](#create-payment)

Creates a new payment record. To perform this operation use `createPayment` method on `Payment` service. `amount`, `referenceId`, `orderDescription`, `notificationUrl` and `redirectUrl` should be provided.

### PaymentCreateOptions

[](#paymentcreateoptions)

`PaymentCreateOptions` is used by payment service for providing request parameters.

**Variable Name****Type****Description**amountfloatGets or sets amount. The amount of the payment transaction. Exactly this amount will be taken from the account of the user who made the payment, and this amount will be displayed to the user on the payment screen. Amount field can be minimum 1.00 and maximum 500000.00referenceIdstringGets or sets reference ID. Reference information of the payment transaction in the merchant system. The transaction will be returned to the merchant without being changed in the result notifications as it was sent to Papara. Must be no more than 100 characters. This area does not have to be unique and Papara does not make such a checkorderDescriptionstringGets or sets order description. Description of the payment transaction. The sent value will be displayed to the user on the Papara checkout page. Having a description that accurately identifies the transaction initiated by the user, will increase the chance of successful paymentnotificationUrlstringGets or sets notification URL. The URL to which payment notification requests (IPN) will be sent. With this field, the URL where the POST will be sent to the payment merchant must be sent. To the URL sent with "notificationUrl", Papara will send a payment object containing all information of the payment with an HTTP POST request immediately after the payment is completed. Make sure that the payment notification (IPN) coming to "NotificationURL" comes from Papara's IP addresses. You can check the payment by calling HTTP GET /payments API method with the "id" field in the submitted JSON. If the merchant returns 200 OK to this request, no notification will be made again. If the merchant does not return 200 OK to this notification, Papara will continue to make payment notification (IPN) requests for 24 hours until the merchant returns to 200 OKredirectUrlstringGets or sets redirect URL. URL to which the user will be redirected at the end of the processturkishNationalIdlongGets or sets national identity number.It provides the control of the identity information sent by the user who will receive the payment, in the Papara system. In case of a conflict of credentials, the transaction will not take placecurrencyintGets or sets currency. Values are “0”, “1”, “2”, “3”### Important Warning

[](#important-warning)

Make sure that the payment notification (IPN) coming to "NotificationURL" comes from Papara's IP addresses. You can check the payment by calling HTTP GET /payments API method with the "id" field in the submitted JSON.

### Service Method

[](#service-method-30)

#### Purpose

[](#purpose-30)

Creates a payment for authorized merchant.

**Method****Params****Return Type**createPaymentPaymentCreateOptionsPaparaResult#### Usage

[](#usage-30)

```
  /**
   * Creates a payment for authorized merchant.
   *
   * @param PaymentCreateOptions $options
   * @return PaparaResult
   */
  public function createPayment()
  {
    $referenceId  = uniqid();

    $paymentCreateOptions = new PaymentCreateOptions;
    $paymentCreateOptions->amount = 1;
    $paymentCreateOptions->notificationUrl = "https://testmerchant.com/notification";
    $paymentCreateOptions->orderDescription = "Payment Unit Test";
    $paymentCreateOptions->redirectUrl = "https://testmerchant.com/userredirect";
    $paymentCreateOptions->referenceId = $referenceId;
    $paymentCreateOptions->turkishNationalId = $this->config["TCKN"];

    $result = $this->client->PaymentService->createPayment($paymentCreateOptions);
    return $result;
  }
```

### Validating Payment Result

[](#validating-payment-result)

Following the user's successful completion of the transaction **before the user is directed to the merchant**, Papara makes a **HTTP POST** request to the `notificationUrl` sent by the merchant with the payment request.

In the `body` part of the request, there will be a JSON object with the same structure as the `data` object of the return value creating a payment request. Sample:

```
{
    "merchantId": "123-4564-8484",
    "userId": "123-987-654",
    "paymentMethod": 1,
    "paymentMethodDescription": "Credit/Debit Card",
    "referenceId": "Merchant Reference",
    "orderDescription": "Description that will be displayed to user on payment page",
    "status": 1,
    "statusDescription": "Completed",
    "amount": 99.99,
    "fee": 1.98,
    "currency": "TRY",
    "notificationUrl": "https://www.papara.com/notification",
    "notificationDone": false,
    "redirectUrl": "https://www.papara.com/userredirect",
    "merchantSecretKey": "Secret key on the merchant panel",
    "paymentUrl": "www.papara.com/pid?6666-5555-ABCD",
    "returningRedirectUrl": "",
    "id": "6666-5555-ABCD",
    "createdAt": "2017-06-09T06:26:15.100Z",
    "turkishNationalId": 12345678901,
}
```

Refund
------

[](#refund)

Refunds a completed payment of the merchant with the provided payment ID .To perform this operation use `refund` method on `Payment` service. `id` should be provided.

### PaymentRefundOptions

[](#paymentrefundoptions)

`PaymentRefundOptions` is used by payment service for providing request parameters.

**Variable Name****Type****Description**idstringGets or sets payment ID### Service Method

[](#service-method-31)

#### Purpose

[](#purpose-31)

Creates a refund for a completed payment for authorized merchant.

**Method****Params****Return Type**refundPaymentRefundOptionsPaparaResult#### Usage

[](#usage-31)

```
  /**
   * Creates a refund for a completed payment for authorized merchant.
   *
   * @param PaymentRefundOptions $options
   * @return PaparaResult
   */
  public function refund()
  {
    $paymentRefundOptions = new PaymentRefundOptions;
    $paymentRefundOptions->id = "PAYMENT_ID";

    $result = $this->client->PaymentService->refund($paymentRefundOptions);
    return $result;
  }
```

List Payments
-------------

[](#list-payments)

Lists the completed payments of the merchant in a sequential order. To perform this operation use `list` method on `Payment` service. `pageIndex` and `pageItemCount` should be provided.

### PaymentListOptions

[](#paymentlistoptions)

`PaymentListOptions` is used by payment service for providing request parameters

**Variable Name****Type****Description**pageIndexintGets or sets page index. It is the index number of the page that is wanted to display from the pages calculated on the basis of the number of records (pageItemCount) desired to be displayed on a page. Note: the first page is always 1pageItemCountIntGets or sets page item count. The number of records that are desired to be displayed on a page### PaymentListItem

[](#paymentlistitem)

`PaymentListItem` is used by payment service to match returning completed payment list values list API.

**Variable Name****Type****Description**IdstringReturns payment IDCreatedAtDateTimeReturns created dateMerchantIdstringReturns merchant IDUserIdstringReturns user IDPaymentMethodintReturns payment Method. 0 - User completed transaction with existing Papara balance 1 - User completed the transaction with a debit / credit card that was previously defined. 2 - User completed transaction via mobile payment.PaymentMethodDescriptionstringReturns payment method descriptionReferenceIdstringReturns reference IDOrderDescriptionstringReturns order descriptionStatusintReturns status. 0 - Awaiting, payment is not done yet. 1 - Payment is done, transaction is completed. 2 - Transactions is refunded by merchant.StatusDescriptionstringReturns status descriptionAmountfloatReturns amountFeefloatReturns feeCurrencyintReturns currency. Values are “0”, “1”, “2”, “3”NotificationUrlstringReturns notification URLNotificationDoneboolReturns if notification was madeRedirectUrlstringReturns redirect URLPaymentUrlstringReturns payment URLMerchantSecretKeystringReturns merchant secret keyReturningRedirectUrlstringReturns returning Redirect URLTurkishNationalIdlongReturns national identity number### Service Method

[](#service-method-32)

#### Purpose

[](#purpose-32)

Returns a list of completed payments sorted by newest to oldest for authorized merchant.

**Method****Params****Return Type**listPaymentListOptionsPaparaResult#### Usage

[](#usage-32)

```
  /**
   * Returns a list of completed payments sorted by newest to oldest for authorized merchant.
   *
   * @param PaymentListOptions $options
   * @return PaparaResult
   */
  public function list()
  {
    $paymentListOptions = new PaymentListOptions;
    $paymentListOptions->pageIndex = 1;
    $paymentListOptions->pageItemCount = 20;

    $paymentListResult = $this->client->PaymentService->list($paymentListOptions);
    return $result;
  }
```

Possible Errors and Error Codes
-------------------------------

[](#possible-errors-and-error-codes-4)

**Error Code****Error Description**997You are not authorized to accept payments. You should contact your customer representative.998The parameters you submitted are not in the expected format. Example: one of the mandatory fields is not provided.999An error occurred in the Papara system.Validation
================================================

[](#validation)

Validation service will be used for validating an end user. Validation can be performed by account number, e-mail address, phone number, national identity number.

Validate By Id
--------------

[](#validate-by-id)

It is used to validate users with Papara UserId. To perform this operation use `validateById` method on `Validation` service. `userId` should be provided.

### Validation Model

[](#validation-model)

`Validation` is used by validation service to match returning user value from API

**Variable Name****Type****Description**UserIdstringReturns unique User IDFirstNamestringReturns user first nameLastNamestringReturns user last nameEmailstringReturns user e-mail addressPhoneNumberstringReturns user phone numberTcknLongReturns user national identity numberAccountNumberint?Returns user account number### ValidationByIdOptions

[](#validationbyidoptions)

`ValidationByIdOptions` is used by validation service for providing request parameters.

**Variable Name****Type****Description**userIdstringGets or sets Papara User ID### Service Method

[](#service-method-33)

#### Purpose

[](#purpose-33)

Returns end user information for validation by given user ID.

**Method****Params****Return Type**validateByIdValidationByIdOptionsPaparaResult#### Usage

[](#usage-33)

```
  /**
   * Returns end user information for validation by given user ID.
   *
   * @param ValidationByIdOptions $options
   * @return PaparaResult
   */
  public function ValidateById()
  {
    $validationByIdOptions = new ValidationByIdOptions;
    $validationByIdOptions->userId = $this->config['PersonalAccountId'];

    $result = $this->client->ValidationService->ValidateById($validationByIdOptions);
    return $result;
  }
```

Validate By Account Number
--------------------------

[](#validate-by-account-number)

It is used to validate users with Papara account number. To perform this operation use `validateByAccountNumber` method on `Validation` service. `accountNumber` should be provided.

### ValidationByAccountNumberOptions

[](#validationbyaccountnumberoptions)

`ValidationByAccountNumberOptions` is used by validation service for providing request parameters

**Variable Name****Type****Description**accountNumberlongGets or sets Papara account number### Service Method

[](#service-method-34)

#### Purpose

[](#purpose-34)

Returns end user information for validation by given user account number.

**Method****Params****Return Type**validateByAccountNumberValidationByAccountNumberOptionsPaparaResult#### Usage

[](#usage-34)

```
  /**
   * Returns end user information for validation by given user account number.
   *
   * @param ValidationByAccountNumberOptions $options
   * @return PaparaResult
   */
  public function ValidateByAccountNumber()
  {
    $validationByAccountNumberOptions = new ValidationByAccountNumberOptions;
    $validationByAccountNumberOptions->accountNumber = $this->config['PersonalAccountNumber'];

    $result = $this->client->ValidationService->ValidateByAccountNumber($validationByAccountNumberOptions);
    return $result;
  }
```

Validate By Phone Number
------------------------

[](#validate-by-phone-number)

It is used to validate users with phone number registered in Papara. To perform this operation use `validateByPhoneNumber` method on `Validation` service. `phoneNumber` should be provided.

### ValidationByPhoneNumberOptions

[](#validationbyphonenumberoptions)

`ValidationByPhoneNumberOptions` is used by validation service for providing request parameters

**Variable Name****Type****Description**phoneNumberstringGets or sets phone number registered to Papara### Service Method

[](#service-method-35)

#### Purpose

[](#purpose-35)

Returns end user information for validation by given user phone number.

**Method****Params****Return Type**validateByPhoneNumberValidationByPhoneNumberOptionsPaparaSingleResult#### Usage

[](#usage-35)

```
/**
   * Returns end user information for validation by given phone number.
   *
   * @param ValidationByPhoneNumberOptions $options
   * @return PaparaResult
   */
  public function ValidateByPhoneNumber()
  {
    $validationByPhoneNumberOptions = new ValidationByPhoneNumberOptions;
    $validationByPhoneNumberOptions->phoneNumber = $this->config['PersonalPhoneNumber'];

    $result = $this->client->ValidationService->ValidateByPhoneNumber($validationByPhoneNumberOptions);
    return $result;
  }
```

Validate By E-Mail Address
--------------------------

[](#validate-by-e-mail-address)

It is used to validate users with e-mail address registered in Papara. To perform this operation use `validateByEmail` method on `Validation` service. `email` should be provided.

### ValidationByEmailOptions

[](#validationbyemailoptions)

`ValidationByEmailOptions` is used by validation service for providing request parameters

**Variable Name****Type****Description**emailstringGets or sets e-mail address registered to Papara### Service Method

[](#service-method-36)

#### Purpose

[](#purpose-36)

Returns end user information for validation by given user e-mail address

**Method****Params****Return Type**validateByEmailValidationByEmailOptionsPaparaResult#### Usage

[](#usage-36)

```
  /**
   * Returns end user information for validation by given user e-mail address.
   *
   * @param ValidationByEmailOptions $options
   * @return PaparaResult
   */
  public function ValidateByEmail()
  {
    $ValidationByEmailOptions = new ValidationByEmailOptions;
    $ValidationByEmailOptions->email = $this->config['PersonalEmail'];

    $result = $this->client->ValidationService->ValidateByEmail($ValidationByEmailOptions);
    return $result;
  }
```

Validate By National Identity Number
------------------------------------

[](#validate-by-national-identity-number)

It is used to validate users with national identity number registered in Papara. To perform this operation use `validateByTckn` method on `Validation` service. `tckn` should be provided.

### ValidationByTcknOptions

[](#validationbytcknoptions)

`ValidationByPhoneNumberOptions` is used by validation service for providing request parameters.

**Variable Name****Type****Description**tcknlongReturns national identity number### Service Method

[](#service-method-37)

#### Purpose

[](#purpose-37)

Returns end user information for validation by given user national identity number

**Method****Params****Return Type**validateByTcknValidationByTcknOptionsPaparaResult#### Usage

[](#usage-37)

```
  /**
   * Returns end user information for validation by given user national identity number.
   *
   * @param ValidationByTcknOptions $options
   * @return PaparaResult
   */
  public function ValidateByTckn()
  {
    $validationByTcknOptions = new ValidationByTcknOptions;
    $validationByTcknOptions->tckn = $this->config['TCKN'];

    $result = $this->client->ValidationService->ValidateByTckn($validationByTcknOptions);
    return $result;
  }
```

Response Types
========================================================

[](#response-types)

This part contains technical information about return values from API.

PaparaServiceResult
-------------------

[](#paparaserviceresult)

Papara Service Result type. Handles response data types returning from API.

**Variable Name****Type****Description**databoolGets or sets single result data.succeededboolGets or sets a value indicating whether operation resulted successfully or noterrorServiceResultErrorGets or sets a value indicating whether operation failed or notresultServiceResultSuccessGets or sets success resultServiceResultError
------------------

[](#serviceresulterror)

Papara Service Error Result type. Error responses returning from API.

**Variable Name****Type****Description**messagestringReturns error messagescodeintReturns error codesServiceResultSuccess
--------------------

[](#serviceresultsuccess)

Papara Service Success Result type. Success responses returning from API.

**Variable Name****Type****Description**MessagestringReturns success messagesCodeintReturns success codes

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~50 days

Total

6

Last Release

1783d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0502b46dec02d957d09a29bc6c1c2dd6ccb63767465785d5ab5c2e25b3f5d627?d=identicon)[crosstech](/maintainers/crosstech)

![](https://www.gravatar.com/avatar/2df775933e9ddd7e152af252cc7a7a7bd346a619b13f96dcfb09b3772c8883ff?d=identicon)[paparateam](/maintainers/paparateam)

![](https://www.gravatar.com/avatar/f567c5f8e6d616b8cf89896d5ca6aef32d04678161f1697110d371a04bd293e0?d=identicon)[eyeminyildiz](/maintainers/eyeminyildiz)

---

Top Contributors

[![mehmetcanhoroz](https://avatars.githubusercontent.com/u/16082678?v=4)](https://github.com/mehmetcanhoroz "mehmetcanhoroz (5 commits)")[![Burotan](https://avatars.githubusercontent.com/u/441897?v=4)](https://github.com/Burotan "Burotan (4 commits)")[![eyEminYILDIZ](https://avatars.githubusercontent.com/u/40744025?v=4)](https://github.com/eyEminYILDIZ "eyEminYILDIZ (3 commits)")[![hylmz](https://avatars.githubusercontent.com/u/80509857?v=4)](https://github.com/hylmz "hylmz (3 commits)")[![tuncii](https://avatars.githubusercontent.com/u/36232764?v=4)](https://github.com/tuncii "tuncii (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/papara-papara/health.svg)

```
[![Health](https://phpackages.com/badges/papara-papara/health.svg)](https://phpackages.com/packages/papara-papara)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
