Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/getparthenon/transaction-cloud
A PHP Library to support the Transaction.cloud payment provider
https://github.com/getparthenon/transaction-cloud
payment-integration php php-library
Last synced: 2 months ago
JSON representation
A PHP Library to support the Transaction.cloud payment provider
- Host: GitHub
- URL: https://github.com/getparthenon/transaction-cloud
- Owner: getparthenon
- License: mit
- Created: 2022-09-23T09:33:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-19T08:31:52.000Z (about 2 years ago)
- Last Synced: 2024-09-13T04:08:24.592Z (4 months ago)
- Topics: payment-integration, php, php-library
- Language: PHP
- Homepage:
- Size: 44.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
Transaction.Cloud PHP SDK
=================This is a library to provide integration to the [Transaction.cloud](https://hosted.transaction.cloud/ref/6HBUF3G5) payment provider system.
[Transaction.cloud](https://hosted.transaction.cloud/ref/6HBUF3G5) is a reseller payment provider. Where it acts as the merchant of record instead of yourself. This means they handle all the legal paperwork required for the actual sale and you just get the money without all the headaches.
## Getting Started
```sh
composer require parthenon/transaction-cloud symfony/http-client nyholm/psr7
``````php
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password");// and if you want to use the sandbox
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password", true);
```## Examples
### Get Url To Manage Transactions
[API Docs](https://app.transaction.cloud/api-docs/#retrieve-url-to-manage-transactions)
```php
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password");
$url = $transactionCloud->getUrlToManageTransactions("[email protected]");
```### Get URL to Admin Dashboard
[API Docs](https://app.transaction.cloud/api-docs/#retrieve-url-of-hosted-admin-app)
```php
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password");
$url = $transactionCloud->getUrlToAdmin();
```### Retrieve Transactions By Email
[API Docs](https://app.transaction.cloud/api-docs/#retrieve-transactions-by-email)
```php
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password");
$transactions = $transactionCloud->getTransactionsByEmail("[email protected]");/** @var $transaction \TransactionCloud\Model\Transaction **/
foreach ($transactions as $transaction) {
// Do something with transaction
}
```### Retrieve Transaction By Transaction ID
[API Docs](https://app.transaction.cloud/api-docs/#retrieve-transaction-by-transaction-id)
```php
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password");
$transaction = $transactionCloud->getTransactionById("TC-TR_xxyyxxx");// do something with transaction.
```### Assign Email Address By Transaction Id
[API Docs](https://app.transaction.cloud/api-docs/#assign-email-address-by-transaction-id)
```php
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password");
$success = $transactionCloud->assignTransactionToEmail("TC-TR_xxyyxxx", "[email protected]");
```### Cancel Subscription
[API Docs](https://app.transaction.cloud/api-docs/#cancel-subscription)
```php
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password");
$success = $transactionCloud->cancelSubscription("TC-TR_xxyyxxx");
```### Refund Transaction
[API Docs](https://app.transaction.cloud/api-docs/#refund-transaction)
```php
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password");
$refundData = $transactionCloud->refundTransaction("TC-TR_xxyyxxx");
```### Retrieve Transactions With Changed Status
[API Docs](https://app.transaction.cloud/api-docs/#retrieve-transactions-with-changed-status)
```php
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password");
$transactions = $transactionCloud->fetchChangedTransactions();/** @var $transaction \TransactionCloud\Model\ChangedTransaction **/
foreach ($transactions as $transaction) {
// Do something with transaction
}
```### Marking Transaction As Processed
[API Docs](https://app.transaction.cloud/api-docs/#marking-transactions-as-processed)
```php
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password");
$success = $transactionCloud->markTransactionAsProcessed("TC-TR_xxyyxxx");
```### Customise Product On Demand
[API Docs](https://app.transaction.cloud/api-docs/#customize-product-on-demand)
```php
$price = \Brick\Money::of("100", "USD");$product = new \TransactionCloud\Model\Product();
$product->setPrices([$price]);
$product->setDescription("Custom product");
$product->setPayload("Payload");
$product->settTansactionIdToMigrate("TC-PR_kdljfdskl");$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password");
$productData = $transacloudCloud->customizeProduct("TC-PR_kdjfde", $product);// $productData instanceof \TransactionCloud\Model\ProductData
```### Get Payment Url For Product
```php
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password");$url = $transactionCloud->getPaymentUrlForProduct("TC-TR_3jsd94");
```## FAQ
### Is this free to use?
Yes. This library is completely open source and is free to use without limitations.
### What support can I get for this?
You can create an issue in this repository and we'll be able to provide support.
### Is this an offical SDK?
No, however, we do have a relationship with Transaction.Cloud.
### Why should I use Transaction.Cloud over Paddle?
It's cheaper. 4.9% vs 5%. Not much but it all adds up.
They're also very responsive in their support matters. We get answers within hours.
[Click here to check them out](https://hosted.transaction.cloud/ref/6HBUF3G5)