PHPackages                             sarkhanrasimoghlu/laravel-golden-pay-payment - 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. [Payment Processing](/categories/payments)
4. /
5. sarkhanrasimoghlu/laravel-golden-pay-payment

ActiveLibrary[Payment Processing](/categories/payments)

sarkhanrasimoghlu/laravel-golden-pay-payment
============================================

Laravel package for Golden Pay payment gateway integration

v1.0.0(2mo ago)10MITPHPPHP ^8.3

Since Apr 10Pushed 2mo agoCompare

[ Source](https://github.com/Rasimoghlu/laravel-golden-pay-payment)[ Packagist](https://packagist.org/packages/sarkhanrasimoghlu/laravel-golden-pay-payment)[ RSS](/packages/sarkhanrasimoghlu-laravel-golden-pay-payment/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Laravel Golden Pay Payment
==========================

[](#laravel-golden-pay-payment)

Laravel package for Golden Pay payment gateway integration. Supports regular payments, Apple Pay, Google Pay, card save &amp; tokenized payments, and subscription/recurring payments.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 12.x
- Guzzle 7.8+

Installation
------------

[](#installation)

```
composer require sarkhanrasimoghlu/laravel-golden-pay-payment
```

The package uses Laravel's auto-discovery, so the service provider will be registered automatically.

### Publish Configuration

[](#publish-configuration)

```
php artisan vendor:publish --tag=golden-pay-config
```

### Run Migrations

[](#run-migrations)

```
php artisan migrate
```

Or publish migrations for customization:

```
php artisan vendor:publish --tag=golden-pay-migrations
```

Configuration
-------------

[](#configuration)

Add the following to your `.env` file:

```
GOLDEN_PAY_BASE_URL=https://rest-newpgtest.goldenpay.az
GOLDEN_PAY_AUTH_KEY=your-auth-key
GOLDEN_PAY_MERCHANT_NAME=your-merchant-name
GOLDEN_PAY_REDIRECT_URL=https://yourapp.com/golden-pay/return
GOLDEN_PAY_SUCCESS_URL=https://yourapp.com/payment/success
GOLDEN_PAY_ERROR_URL=https://yourapp.com/payment/error

# Card Save & Subscription API (Basic Auth)
GOLDEN_PAY_BASIC_USERNAME=your-username
GOLDEN_PAY_BASIC_PASSWORD=your-password

# Optional
GOLDEN_PAY_LANGUAGE=az
GOLDEN_PAY_TIMEOUT=30
GOLDEN_PAY_LOG_CHANNEL=stack
GOLDEN_PAY_LOG_LEVEL=info
```

### Environments

[](#environments)

EnvironmentBase URLTest`https://rest-newpgtest.goldenpay.az`Production`https://rest-pg.goldenpay.az`Usage
-----

[](#usage)

### Regular Payment

[](#regular-payment)

```
use Sarkhanrasimoghlu\GoldenPay\Contracts\GoldenPayServiceInterface;
use Sarkhanrasimoghlu\GoldenPay\DataTransferObjects\PaymentRequest;
use Sarkhanrasimoghlu\GoldenPay\Enums\Language;

$service = app(GoldenPayServiceInterface::class);

$response = $service->createPayment(new PaymentRequest(
    amount: 10.50,
    description: 'Order #1234',
    language: Language::AZ,
    orderId: '1234',
));

if ($response->isSuccessful()) {
    return redirect($response->payPageUrl);
}
```

### Apple Pay / Google Pay

[](#apple-pay--google-pay)

```
use Sarkhanrasimoghlu\GoldenPay\Enums\CardType;

$response = $service->createPayment(new PaymentRequest(
    amount: 10.50,
    description: 'Order #1234',
    cardType: CardType::ApplePay, // or CardType::GooglePay
    orderId: '1234',
));
```

### Get Payment Result

[](#get-payment-result)

```
$result = $service->getPaymentResult($paymentKey);

if ($result->isSuccessful()) {
    // Payment succeeded
    $cardNumber = $result->cardNumber;
    $rrn = $result->rrn;
}
```

### Reverse / Refund

[](#reverse--refund)

```
use Sarkhanrasimoghlu\GoldenPay\DataTransferObjects\ReverseRequest;

$result = $service->reversePayment(new ReverseRequest(
    paymentKey: 'e93585e2-426d-440a-ae54-67bd20d362be',
    amount: 10.50,
));

if ($result->isSuccessful()) {
    // Payment reversed
}
```

### Card Save

[](#card-save)

```
use Sarkhanrasimoghlu\GoldenPay\DataTransferObjects\CardSaveRequest;

$response = $service->saveCard(new CardSaveRequest(
    pin: 'customer-unique-id',
    phone: '+994501234567',
    fullName: 'John Doe',
    description: 'Save card for future payments',
));

// Redirect user to card entry page
return redirect($response->payPage);
```

### Pay with Saved Card

[](#pay-with-saved-card)

```
use Sarkhanrasimoghlu\GoldenPay\DataTransferObjects\CardPayRequest;

// 1. Create payment key
$payment = $service->createCardPayment(new CardPayRequest(
    amount: 20.00,
    description: 'Recurring charge',
));

// 2. Execute payment with card token
$result = $service->cardPay($payment->key, $cardToken);

if ($result->isSuccessful()) {
    // Payment completed
}
```

### Get User's Saved Cards

[](#get-users-saved-cards)

```
$cards = $service->getUserCards('customer-pin');
```

### Delete Saved Card

[](#delete-saved-card)

```
$service->deleteCard($paymentKey);
```

### Subscription

[](#subscription)

```
use Sarkhanrasimoghlu\GoldenPay\DataTransferObjects\SubscriptionRequest;

// Create subscriber
$subscriber = $service->createSubscriber(new SubscriptionRequest(
    amount: 29.99,
    identifierKey: 'customer-fin-code',
    callbackUrl: 'https://yourapp.com/subscription/callback',
    phone: '+994501234567',
    fullName: 'John Doe',
    description: 'Monthly subscription',
    cardToken: $existingCardToken, // null if card needs to be saved first
));

// Get subscriber details
$details = $service->getSubscriber($subscriberId);

// Cancel subscriber
$service->cancelSubscriber($subscriberId);
```

Return URL
----------

[](#return-url)

The package registers two routes to handle the return from Golden Pay:

- `GET /golden-pay/return?payment_key={key}` (named `golden-pay.return`)
- `GET /golden-pay/return/{paymentKey}` (named `golden-pay.return.key`)

Set your `GOLDEN_PAY_REDIRECT_URL` to point to one of these routes. The controller will verify the payment result and redirect the user to your `success_url` or `error_url`.

Events
------

[](#events)

The package dispatches events you can listen to:

EventWhen`PaymentCreated`Payment key obtained, user redirected to pay page`PaymentCompleted`Payment result verified as successful`PaymentFailed`Payment result verified as failed```
// In your EventServiceProvider
use Sarkhanrasimoghlu\GoldenPay\Events\PaymentCompleted;

protected $listen = [
    PaymentCompleted::class => [
        YourPaymentCompletedListener::class,
    ],
];
```

API Reference
-------------

[](#api-reference)

### Payment Gateway

[](#payment-gateway)

MethodEndpointDescription`createPayment()``POST /getPaymentKey`Initialize a payment`getPaymentResult()``GET /getPaymentResult`Check payment outcome`reversePayment()``POST /reversePaymentKey`Reverse/refund a payment### Card Save

[](#card-save-1)

MethodEndpointDescription`saveCard()``POST /api/1.0/card-save/cards`Save card, get token`createCardPayment()``POST /api/1.0/card-save/payments`Create payment key`cardPay()``POST /api/1.0/card-save/payments/{id}/pay`Pay with saved card`getUserCards()``GET /api/1.0/card-save/cards/user-cards`List user's cards`getMerchantCards()``GET /api/1.0/card-save/cards/merchant-cards`List merchant's cards`getCardPaymentStatus()``GET /api/1.0/card-save/payments/{key}`Check card payment status`deleteCard()``DELETE /api/1.0/card-save/cards/{key}`Delete saved card### Subscription

[](#subscription-1)

MethodEndpointDescription`createSubscriber()``POST /api/1.0/subscribers/create`Create subscriber`getSubscriber()``GET /api/1.0/subscribers/{id}`Get subscriber details`cancelSubscriber()``PATCH /api/v1/subscribers/{id}/cancel`Cancel subscriberStatus Codes
------------

[](#status-codes)

CodeDescription1Success803Hashcode empty or mismatch811Payment key empty812Invalid payment key813Payment not finished814Payment canceled815Payment error816Payment failed817Payment reversed818Payment in progress819Payment timeout900Internal exception901Invalid request dataDatabase
--------

[](#database)

The package creates a `golden_pay_transactions` table with the following columns:

ColumnTypeDescription`payment_key`string(36)Unique payment identifier`order_id`stringYour application's order ID`amount`decimal(10,2)Payment amount`status`stringpending, succeeded, failed, reversed`merchant_name`stringMerchant name`card_number`stringMasked card number`rrn`stringReference number`payment_date`stringPayment date from Golden Pay`description`stringPayment description`paid_at`timestampWhen payment succeededError Handling
--------------

[](#error-handling)

```
use Sarkhanrasimoghlu\GoldenPay\Exceptions\GoldenPayException;
use Sarkhanrasimoghlu\GoldenPay\Exceptions\HttpException;
use Sarkhanrasimoghlu\GoldenPay\Exceptions\InvalidPaymentException;

try {
    $response = $service->createPayment($request);
} catch (InvalidPaymentException $e) {
    // Invalid payment parameters
} catch (HttpException $e) {
    // API connection or response error
} catch (GoldenPayException $e) {
    // General Golden Pay error
}
```

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance88

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

60d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/45317065?v=4)[Sarkhan Nasibli](/maintainers/Rasimoghlu)[@Rasimoghlu](https://github.com/Rasimoghlu)

---

Top Contributors

[![Rasimoghlu](https://avatars.githubusercontent.com/u/45317065?v=4)](https://github.com/Rasimoghlu "Rasimoghlu (1 commits)")

---

Tags

laravelpaymentazerbaijangoldenpaygolden-pay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sarkhanrasimoghlu-laravel-golden-pay-payment/health.svg)

```
[![Health](https://phpackages.com/badges/sarkhanrasimoghlu-laravel-golden-pay-payment/health.svg)](https://phpackages.com/packages/sarkhanrasimoghlu-laravel-golden-pay-payment)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.5M901](/packages/statamic-cms)[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.6M217](/packages/backpack-crud)[unopim/unopim

UnoPim Laravel PIM

10.1k2.2k](/packages/unopim-unopim)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4849.3k](/packages/sebdesign-laravel-viva-payments)[tsaiyihua/laravel-linepay

linepay library for laravel

103.4k](/packages/tsaiyihua-laravel-linepay)

PHPackages © 2026

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