PHPackages                             rocalex/global-open-sdk-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rocalex/global-open-sdk-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rocalex/global-open-sdk-php
===========================

0.1.2(2y ago)024PHP

Since Jul 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rocalex/global-open-sdk-php)[ Packagist](https://packagist.org/packages/rocalex/global-open-sdk-php)[ RSS](/packages/rocalex-global-open-sdk-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

```
Language：PHP
PHP version：5.4.7+
Copyright：Ant financial services group

```

#### 1 Important note

[](#1-important-note)

The SDK mainly shows how to access the alipay gateway, which cannot guarantee the performance and stability.

#### 2 The demo code for create order

[](#2-the-demo-code-for-create-order)

```
$alipayCreateOrderRequest = new AlipayCreateOrderRequest();

$clientId = "your clientId";
$path = "/ams/sandbox/api/v1/payments/create";

$productCode = ProductCodeType::CASHIER_PAYMENT;
$paymentRequestId = "demo-test-id";
$order = new Order();
$order->setOrderDescription("test order desc");
$order->setReferenceOrderId("102775745075669");
$orderAmount = new Amount();
$orderAmount->setCurrency("USD");
$orderAmount->setValue("100");
$order->setOrderAmount($orderAmount);

$paymentAmount = new Amount();
$paymentAmount->setCurrency("USD");
$paymentAmount->setValue("100");
$paymentNotifyUrl = "https://www.alipay.com/notify";
$paymentRedirectUrl = "https://www.alipay.com";

$alipayCreateOrderRequest->setClientId($clientId);
$alipayCreateOrderRequest->setPath($path);
$alipayCreateOrderRequest->setProductCode($productCode);
$alipayCreateOrderRequest->setPaymentRequestId($paymentRequestId);
$alipayCreateOrderRequest->setPaymentAmount($paymentAmount);
$alipayCreateOrderRequest->setOrder($order);
$alipayCreateOrderRequest->setPaymentNotifyUrl($paymentNotifyUrl);
$alipayCreateOrderRequest->setPaymentRedirectUrl($paymentRedirectUrl);

$merchantPrivateKey =  "your privateKey";
$alipayPublicKey    =  "your alipayPublicKey";

$alipayClient   = new DefaultAlipayClient("https://open-sea.alipay.com", $merchantPrivateKey, $alipayPublicKey);
$alipayResponse = $alipayClient->execute($alipayCreateOrderRequest);
```

The execute method contains the HTTP request to the gateway.

If you're concerned about HTTP invocation performance, you can implement HTTP invocation yourself.

```
class YourAlipayClient extends BaseAlipayClient{

    function __construct($gatewayUrl, $merchantPrivateKey, $alipayPublicKey) {
        parent::__construct($gatewayUrl, $merchantPrivateKey, $alipayPublicKey);
    }

    protected function buildCustomHeader(){
        return null;
    }

    protected function sendRequest($requestUrl, $httpMethod, $headers, $reqBody){
        $httpRpcResult = new HttpRpcResult();

        // TODO
        // $httpRpcResult->setRspBody($rspBody);
        // $httpRpcResult->setRspSign($rspSign);
        // $httpRpcResult->setRspTime($rspTime);

        return $httpRpcResult;
    }

}

$yourAlipayClient  = new YourAlipayClient("https://open-sea.alipay.com", $merchantPrivateKey, $alipayPublicKey);
$alipayPayResponse = $yourAlipayClient->execute($aliPayRequest);
```

#### 3 If you don't care about HTTP calls,the sample for sign and verify

[](#3-if-you-dont-care-about-http-callsthe-sample-for-sign-and-verify)

```
$signReqValue  = SignatureTool::sign($httpMethod, $path, $clientId, $reqTime, $reqBody, $merchantPrivateKey);
$isVerifyPass  = SignatureTool::verify($httpMethod, $path, $clientId, $rspTime, $rspBody, $rspSignValue, $alipayPublicKey);

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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

1038d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9605c0974176f1387b2c5ddc58b9dbd322903d24f2cb766c68d0c71ba07c2ecd?d=identicon)[rocalex](/maintainers/rocalex)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/rocalex-global-open-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/rocalex-global-open-sdk-php/health.svg)](https://phpackages.com/packages/rocalex-global-open-sdk-php)
```

###  Alternatives

[netzmacht/contao-leaflet-maps

Contao Leaflet maps integration

1111.0k1](/packages/netzmacht-contao-leaflet-maps)

PHPackages © 2026

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