The Rise of Contactless Payments:...
In recent years, contactless payments have surged in popularity, driven...
@extends('developer.layouts.master')
@section('content')
<div class="developer-body-wrapper">
<div class="developer-main-wrapper">
<div class="row mb-30-none">
<div class="col-lg-6 mb-30">
<h1 class="heading-title mb-20">{{ __("Initiate Payment") }}</h1>
<p>{{ __("Initiates a new payment transaction.") }}</p>
<div class="mb-10">
<strong>{{ __("Endpoint") }}:</strong> <span class="badge custom rounded-pill bg-primary">POST</span> <code class="fw-bold fs-6" style="color: #EE8D1D;"><code></code>create-order</code>
</div>
<div class="table-responsive">
<table class="table table-striped token-table">
<thead>
<tr>
<th scope="col">{{ __("Parameter") }}</th>
<th scope="col">{{ __("Type") }}</th>
<th scope="col">{{ __("Details") }}</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">amount</th>
<td>decimal</td>
<td>{{ __("Your Amount , Must be rounded at 2 precision.") }}</td>
</tr>
<tr>
<th scope="row">currency</th>
<td>string</td>
<td>{{ __("Currency Code, Must be in Upper Case (Alpha-3 code)") }}</td>
</tr>
<tr>
<th scope="row">success_url</th>
<td>string</td>
<td>{{ __("Enter your return or success URL") }}</td>
</tr>
<tr>
<th scope="row">cancel_url</th>
<td>string (optional)</td>
<td>{{ __("Enter your cancel or failed URL") }}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-lg-6 mb-30">
<pre class="prettyprint mt-0" style="white-space: normal;">
<span class="code-show-list">
<span>Request Example (guzzle)</span>
<br>
<span>
<br><?php
<br> require_once('vendor/autoload.php');
<br> $client = new \GuzzleHttp\Client();
<br> $response = $client->request('POST', $base_url.'create-order', [
<br>'headers' => [
<br> 'Authorization' => 'Bearer '. $authorizationToken,
<br> 'accept' => 'application/json',
<br> 'content-type' => 'application/json',
<br> ],
<br>'form_params' => [
<br> 'amount' => '$amount',
<br> 'currency' => 'currency',
<br> 'success_url' => 'success_url',
<br> 'cancel_url' => 'cancel_url',
<br> ],
<br>]);
<br>echo $response->getBody();
</span>
</span>
</pre>
<pre class="prettyprint mt-0" style="white-space: normal;">
<span class="code-show-list">
<br>**Response: SUCCESS (200 OK)**
<br>{
<br> "message": {
<br> "success": [
<br> "Order created successfully."
<br> ]
<br>},
<br>"data": {
<br> "redirect_url":"https://example.com/login/OISADFDFSDFSF",
<br> "order_details":{
<br> "amount" : "10",
<br> "fixed_charge" : 2,
<br> "percent_charge" : 1,
<br> "total_charge" : 3,
<br> "total_payable" : 13,
<br> "currency" : "USD",
<br> "expiry_time": "2024-04-25T06:48:35.984285Z",
<br> "success_url": "http://127.0.0.1/nfcpay/user/transaction/success",
<br> "cancel_url": "http://127.0.0.1/nfcpay/user/transaction/cancel"
<br>}
<br>},
<br>"type": "success"
<br>}
</span>
</pre>
<pre class="prettyprint mt-0" style="white-space: normal;">
<span class="code-show-list">
<br>**Response: ERROR (400 FAILED)**
<br>{
<br> "message": {
<br> "error": [
<br> "Invalid token."
<br> ]
<br>},
<br>"data": null,
<br>"type": "error"
<br>}
</span>
</pre>
</div>
</div>
</div>
<div class="page-change-area">
<div class="navigation-wrapper">
<a href="{{ setRoute('frontend.developer.access.token') }}" class="left"><i class="las la-arrow-left me-1"></i> {{ __("Access Token") }}</a>
<a href="{{ setRoute('frontend.developer.check.payment') }}" class="right">{{ __("Check Payment Status") }} <i class="las la-arrow-right ms-1"></i></a>
</div>
</div>
</div>
@endsection
Blog Section
Dive into our blog to explore the cutting-edge trends in digital payments and NFC technology. Stay updated on the innovations that are revolutionizing transactions, boosting security, and making payments quicker and more convenient. Learn how these advancements are shaping the future of financial interactions and driving the global transition towards a cashless world.
In recent years, contactless payments have surged in popularity, driven...
As digital transactions proliferate, ensuring robust payment security is more critical than ever. Two foundational...
Digital wallets have fundamentally transformed how we manage money, offering a streamlined, secure, and highly...