parthenon / transaction-cloud
A PHP Library to provide integration with transaction.cloud
Installs: 2 936
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- brick/money: ^0.6.0
- php-http/client-common: ^2.5
- php-http/discovery: ^1.14
- psr/http-client: ^1.0
- psr/http-message: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.11
- nyholm/psr7: ^1.5
- php-http/guzzle7-adapter: ^1.0
- phpunit/phpunit: ^9.5
README
This is a library to provide integration to the Transaction.cloud payment provider system.
Transaction.cloud 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
composer require parthenon/transaction-cloud symfony/http-client nyholm/psr7
$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
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password"); $url = $transactionCloud->getUrlToManageTransactions("iain.cambridge@example.org");
Get URL to Admin Dashboard
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password"); $url = $transactionCloud->getUrlToAdmin();
Retrieve Transactions By Email
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password"); $transactions = $transactionCloud->getTransactionsByEmail("iain.cambridge@example.org"); /** @var $transaction \TransactionCloud\Model\Transaction **/ foreach ($transactions as $transaction) { // Do something with transaction }
Retrieve Transaction By Transaction ID
$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
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password"); $success = $transactionCloud->assignTransactionToEmail("TC-TR_xxyyxxx", "new.iain@example.org");
Cancel Subscription
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password"); $success = $transactionCloud->cancelSubscription("TC-TR_xxyyxxx");
Refund Transaction
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password"); $refundData = $transactionCloud->refundTransaction("TC-TR_xxyyxxx");
Retrieve Transactions With Changed Status
$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
$transactionCloud = new \TransactionCloud\TransactionCloud::create("api_key", "api_key_password"); $success = $transactionCloud->markTransactionAsProcessed("TC-TR_xxyyxxx");
Customise Product On Demand
$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
$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.