Skip to content

Commit

Permalink
chore: update SDK from api-definitions (#679)
Browse files Browse the repository at this point in the history
Co-authored-by: rebilly-machine-user <[email protected]>
Co-authored-by: Arif Kurkchi <[email protected]>
  • Loading branch information
3 people authored Apr 10, 2024
1 parent 111b3ed commit b12425b
Show file tree
Hide file tree
Showing 476 changed files with 23,771 additions and 22,659 deletions.
5 changes: 0 additions & 5 deletions .changeset/clean-buttons-hide.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/cool-kiwis-drop.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/curly-beers-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Allow negative risk score rule values Rebilly/api-definitions#1865
5 changes: 0 additions & 5 deletions .changeset/curvy-ligers-serve.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/cyan-bikes-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add riskMetadata field Rebilly/api-definitions#1860
5 changes: 5 additions & 0 deletions .changeset/flat-hats-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Rename orderId to subscriptionId in quotes Rebilly/api-definitions#1856
5 changes: 5 additions & 0 deletions .changeset/forty-beds-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add orderId to Subscription and OneTimeSale yaml files Rebilly/api-definitions#1849
5 changes: 5 additions & 0 deletions .changeset/gentle-walls-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add detail to default instrument description Rebilly/api-definitions#1846
5 changes: 5 additions & 0 deletions .changeset/gold-shrimps-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Update subscription/one-time-sale prefix examples Rebilly/api-definitions#1863
5 changes: 0 additions & 5 deletions .changeset/heavy-mayflies-explain.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/hot-kids-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add BVNK gateway config Rebilly/api-definitions#1857
5 changes: 0 additions & 5 deletions .changeset/khaki-clocks-relate.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/large-llamas-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Rename Quote embedded order to subscription Rebilly/api-definitions#1862
5 changes: 5 additions & 0 deletions .changeset/lazy-keys-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add field to RiskMetadata.extraData Rebilly/api-definitions#1858
5 changes: 5 additions & 0 deletions .changeset/odd-chicken-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add 409 response KYC verification finish endpoint Rebilly/api-definitions#1867
5 changes: 5 additions & 0 deletions .changeset/popular-radios-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Update orderId description Rebilly/api-definitions#1853
5 changes: 5 additions & 0 deletions .changeset/pretty-eggs-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add LaCore integration Rebilly/api-definitions#1851
5 changes: 5 additions & 0 deletions .changeset/proud-falcons-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add deposit-request customFields Rebilly/api-definitions#1841
5 changes: 0 additions & 5 deletions .changeset/rich-gorillas-sneeze.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/rotten-oranges-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Update subscription/one-time-sale prefix examples Rebilly/api-definitions#1824
5 changes: 5 additions & 0 deletions .changeset/shaggy-kangaroos-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add payout settings to BVNK Rebilly/api-definitions#1861
5 changes: 5 additions & 0 deletions .changeset/silver-carrots-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add churnTimePolicy to subscription cancellation Rebilly/api-definitions#1839
5 changes: 0 additions & 5 deletions .changeset/silver-chefs-dream.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/swift-parrots-swim.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/unlucky-lemons-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Update patch subscription item status code Rebilly/api-definitions#1854
7 changes: 4 additions & 3 deletions examples/authJwt.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This source file is proprietary and part of Rebilly.
*
Expand All @@ -12,8 +13,8 @@
declare(strict_types=1);

use Rebilly\Sdk\Client;
use Rebilly\Sdk\CoreService;
use Rebilly\Sdk\Model\Product;
use Rebilly\Sdk\Service;

require_once __DIR__ . '/../vendor/autoload.php';

Expand All @@ -22,14 +23,14 @@
'organizationId' => '{organizationId}',
'sessionToken' => '{jwtToken}',
]);
$coreService = new CoreService(client: $client);
$service = new Service(client: $client);

function printProduct(Product $product): void
{
printf("Product #%s: %s\n", $product->getId(), $product->getName());
}

$productsPaginator = $coreService->products()->getAllPaginator(limit: 2);
$productsPaginator = $service->products()->getAllPaginator(limit: 2);

foreach ($productsPaginator as $productPage) {
printf("Products page %d/%d\n", $productsPaginator->key() + 1, $productsPaginator->count());
Expand Down
9 changes: 5 additions & 4 deletions examples/createEntity.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This source file is proprietary and part of Rebilly.
*
Expand All @@ -12,8 +13,8 @@
declare(strict_types=1);

use Rebilly\Sdk\Client;
use Rebilly\Sdk\CoreService;
use Rebilly\Sdk\Model\Product;
use Rebilly\Sdk\Service;

require_once __DIR__ . '/../vendor/autoload.php';

Expand All @@ -22,15 +23,15 @@
'organizationId' => '{organizationId}',
'apiKey' => '{secretKey}',
]);
$coreService = new CoreService(client: $client);
$service = new Service(client: $client);

// Create entity using setters

$product1 = Product::from()
->setName('Test setters product')
->setDescription('Test setters description');

$coreService->products()->create($product1);
$service->products()->create($product1);

printEntity($product1);

Expand All @@ -41,7 +42,7 @@
'description' => 'Test fromArray description',
]);

$coreService->products()->create($product2);
$service->products()->create($product2);

printEntity($product2);

Expand Down
7 changes: 4 additions & 3 deletions examples/pagination.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This source file is proprietary and part of Rebilly.
*
Expand All @@ -12,8 +13,8 @@
declare(strict_types=1);

use Rebilly\Sdk\Client;
use Rebilly\Sdk\CoreService;
use Rebilly\Sdk\Model\Product;
use Rebilly\Sdk\Service;

require_once __DIR__ . '/../vendor/autoload.php';

Expand All @@ -22,14 +23,14 @@
'organizationId' => '{organizationId}',
'apiKey' => '{secretKey}',
]);
$coreService = new CoreService(client: $client);
$service = new Service(client: $client);

function printProduct(Product $product): void
{
printf("Product #%s: %s\n", $product->getId(), $product->getName());
}

$productsPaginator = $coreService->products()->getAllPaginator(limit: 2);
$productsPaginator = $service->products()->getAllPaginator(limit: 2);

foreach ($productsPaginator as $productPage) {
printf("Products page %d/%d\n", $productsPaginator->key() + 1, $productsPaginator->count());
Expand Down
35 changes: 17 additions & 18 deletions examples/purchase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This source file is proprietary and part of Rebilly.
*
Expand All @@ -10,22 +11,21 @@
*/

use Rebilly\Sdk\Client;
use Rebilly\Sdk\CoreService;
use Rebilly\Sdk\Exception\DataValidationException;
use Rebilly\Sdk\Model\ContactObject;
use Rebilly\Sdk\Model\Customer;
use Rebilly\Sdk\Model\OriginalPlan;
use Rebilly\Sdk\Model\PaymentCardToken;
use Rebilly\Sdk\Model\PaymentInstructionToken;
use Rebilly\Sdk\Model\Plan;
use Rebilly\Sdk\Model\PlanFormulaFlatRate;
use Rebilly\Sdk\Model\PostTransactionRequest;
use Rebilly\Sdk\Model\Product;
use Rebilly\Sdk\Model\Subscription;
use Rebilly\Sdk\Model\SubscriptionOrOneTimeSaleItem;
use Rebilly\Sdk\Model\SubscriptionOrOneTimeSaleItemPlan;
use Rebilly\Sdk\Model\SubscriptionPlan;
use Rebilly\Sdk\Model\SubscriptionPlanRecurringInterval;
use Rebilly\Sdk\Model\Website;
use Rebilly\Sdk\UsersService;
use Rebilly\Sdk\Service;

require_once __DIR__ . '/../vendor/autoload.php';

Expand All @@ -34,8 +34,7 @@
'organizationId' => '{organizationId}',
'apiKey' => '{secretKey}',
]);
$coreService = new CoreService(client: $client);
$usersService = new UsersService(client: $client);
$service = new Service(client: $client);

function printEntity(mixed $entity): void
{
Expand All @@ -52,7 +51,7 @@ function printEntity(mixed $entity): void
->setServicePhone('1234567890')
->setServiceEmail('[email protected]');

$website = $usersService->websites()->create($website);
$website = $service->websites()->create($website);
$websiteId = $website->getId();

// Create customer
Expand All @@ -67,7 +66,7 @@ function printEntity(mixed $entity): void

printEntity($customer);

$customer = $coreService->customers()->create($customer);
$customer = $service->customers()->create($customer);

echo 'Customer: ' . $customer->getId() . PHP_EOL;
printEntity($customer);
Expand All @@ -80,14 +79,14 @@ function printEntity(mixed $entity): void

printEntity($product);

$product = $coreService->products()->create($product);
$product = $service->products()->create($product);

echo 'Product: ' . $product->getId() . PHP_EOL;
printEntity($product);

// Create plan

$plan = Plan::from([])
$plan = SubscriptionPlan::from([])
->setProductId($product->getId())
->setName('Test plan')
->setCurrency('USD')
Expand All @@ -103,7 +102,7 @@ function printEntity(mixed $entity): void

printEntity($plan);

$plan = $coreService->plans()->create($plan);
$plan = $service->plans()->create($plan);

echo 'Plan: ' . $plan->getId() . PHP_EOL;
printEntity($plan);
Expand All @@ -116,21 +115,21 @@ function printEntity(mixed $entity): void
->setItems([
SubscriptionOrOneTimeSaleItem::from()
->setPlan(
SubscriptionOrOneTimeSaleItemPlan::from()
OriginalPlan::from()
->setId($plan->getId())
)
->setQuantity(1),
->setQuantity(1),
]);

printEntity($subscription);

/** @var Subscription $subscription */
$subscription = $coreService->subscriptions()->create($subscription);
$subscription = $service->subscriptions()->create($subscription);

echo 'Subscription: ' . $subscription->getId() . PHP_EOL;
printEntity($subscription);

$invoice = $coreService->invoices()->get($subscription->getInitialInvoiceId());
$invoice = $service->invoices()->get($subscription->getInitialInvoiceId());

echo 'Initial invoice: ' . $invoice->getId() . PHP_EOL;
printEntity($invoice);
Expand All @@ -148,7 +147,7 @@ function printEntity(mixed $entity): void

printEntity($token);

$token = $coreService->paymentTokens()->create($token);
$token = $service->paymentTokens()->create($token);

echo 'Token: ' . $token->getId() . PHP_EOL;
printEntity($token);
Expand All @@ -172,12 +171,12 @@ function printEntity(mixed $entity): void

printEntity($transactionRequest);

$transaction = $coreService->transactions()->create($transactionRequest);
$transaction = $service->transactions()->create($transactionRequest);

echo 'Transaction: ' . $transaction->getId() . PHP_EOL;
printEntity($transaction);

$subscription = $coreService->subscriptions()->get($subscription->getId());
$subscription = $service->subscriptions()->get($subscription->getId());

printEntity($subscription);
} catch (DataValidationException $e) {
Expand Down
Loading

0 comments on commit b12425b

Please sign in to comment.