wowmaking / web-purchases
1.3.19
2024-09-20 09:50 UTC
Requires
- php: >=7.2.0
- ext-json: *
- ext-openssl: *
- facebook/php-business-sdk: ^12.0
- guzzlehttp/guzzle: ^7.3
- recurly/recurly-client: ^4.6
- stripe/stripe-php: ^7.93
- dev-master
- 1.3.19
- 1.3.18
- 1.3.17
- 1.3.16
- 1.3.15
- 1.3.14
- 1.3.13
- 1.3.12
- 1.3.11
- 1.3.10
- 1.3.9
- 1.3.8
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3
- 1.2
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.0.51.x-dev
- 1.0.51
- 1.0.50.x-dev
- 1.0.50
- 1.0.49.x-dev
- 1.0.48.x-dev
- 1.0.48
- 1.0.47.x-dev
- 1.0.47
- 1.0.46.x-dev
- 1.0.46
- 1.0.45.x-dev
- 1.0.45
- 1.0.44.x-dev
- 1.0.44
- 1.0.43.x-dev
- 1.0.42.x-dev
- 1.0.42
- 1.0.41.x-dev
- 1.0.41
- 1.0.40.x-dev
- 1.0.40
- 1.0.39.x-dev
- 1.0.39
- 1.0.38.x-dev
- 1.0.38
- 1.0.37.x-dev
- 1.0.37
- 1.0.36.x-dev
- 1.0.36
- 1.0.35.x-dev
- 1.0.35
- 1.0.34.x-dev
- 1.0.34
- 1.0.33.x-dev
- 1.0.33
- 1.0.32.x-dev
- 1.0.32
- 1.0.31.x-dev
- 1.0.31
- 1.0.30.x-dev
- 1.0.30
- 1.0.29.x-dev
- 1.0.29
- 1.0.28.x-dev
- 1.0.27.x-dev
- 1.0.27
- 1.0.26.x-dev
- 1.0.26
- 1.0.25.x-dev
- 1.0.25
- 1.0.24.x-dev
- 1.0.24
- 1.0.23.x-dev
- 1.0.23
- 1.0.22.x-dev
- 1.0.22
- 1.0.21.x-dev
- 1.0.20.x-dev
- 1.0.20
- 1.0.19.x-dev
- 1.0.19
- 1.0.18.x-dev
- 1.0.18
- 1.0.17.x-dev
- 1.0.17
- 1.0.16.x-dev
- 1.0.16
- 1.0.15.x-dev
- 1.0.15
- 1.0.14.x-dev
- 1.0.14
- 1.0.13.x-dev
- 1.0.13
- 1.0.12.x-dev
- 1.0.12
- 1.0.11.x-dev
- 1.0.11
- 1.0.10.x-dev
- 1.0.10
- 1.0.9.x-dev
- 1.0.9
- 1.0.8.x-dev
- 1.0.8
- 1.0.7.x-dev
- 1.0.6.x-dev
- 1.0.6
- 1.0.5.x-dev
- 1.0.4.x-dev
- 1.0.4
- 1.0.3.x-dev
- 1.0.3
- 1.0.2.x-dev
- 1.0.2
- 1.0.1.x-dev
- 1.0.0.x-dev
- 1.0.0
- dev-googlepay
- dev-AS-6910-count-products
- dev-AS-6498-add-solid-metadata
- dev-MH-5188-update-multi-currency
- dev-AS-6072-update-idfm
- dev-MAGNUS-3688-disable-data-sending
- dev-add-apple-pay-one-time
- dev-fixed-trial-dates
- dev-AS-4318
This package is not auto-updated.
Last update: 2024-11-14 16:28:00 UTC
README
composer require wowmaking/web-purchases
Supported payment services
- stripe
- recurly
- paypal (Not supports customers)
- solidgate (Not supports customers)
Clients required parameters
stripe
- client_type = stripe
- secret_key
recurly
- client_type = recurly
- public_key
- secret_key
paypal
- client_type = paypal
- secret_key
- client_id
- sandbox
solidgate
- client_type = solidgate
- secret_key
- merchant_id
- webhook_secret_key
- webhook_merchant_id
Require
- "php": ">=7.2.0"
- "stripe/stripe-php": "^7"
- "recurly/recurly-client": "^4"
- "guzzlehttp/guzzle": "^7.3"
- "facebook/php-business-sdk": "^12.0"
Entities
Client
use Wowmaking\WebPurchases\WebPurchases;
$clientParams = [
'client_type' => 'stripe',
'secret_key' => ...
];
$subtruckParams = [
'token' => ...,
'idfm' => ...
];
$fbPixelParams = [
'token' => ...,
'pixel_id' => ...,
'domain' => ...,
'ip' => ...,
'user_agent' => ...,
'fbc' => ...,
'fbp' => ...,
];
$webPurchases = WebPurchases::service(array $clientParams, ?array $subtruckParams, ?array $fbPixelParams);
Price
Fields
- id
- amount
- currency
- trial_period_days
- trial_price_amount
Methods
use Wowmaking\WebPurchases\Resources\Entities\Price;
$prices = $webPurchases->getPurchasesClient()->getPrices(array $filterPricesIds = []));
Customer
Fields
- id
- provider
- provider_response
Methods
use Wowmaking\WebPurchases\Resources\Entities\Customer;
$customer = $webPurchases->getPurchasesClient()->createCustomer(array $data);
$customers = $webPurchases->getPurchasesClient()->getCustomers(array $params);
$customer = $webPurchases->getPurchasesClient()->getCustomer(string $customerId);
$customer = $webPurchases->getPurchasesClient()->updateCustomer(string $customerId, array $data);
Subscription
Fields
- transaction_id
- plan_name
- currency
- amount
- customer_id
- created_at
- trial_start_at
- trial_end_at
- expire_at
- canceled_at
- state
- is_active
- provider
- provider_response
Methods
Create subscription
use Wowmaking\WebPurchases\Resources\Entities\Subscription;
$subscription = $webPurchases->getPurchasesClient()->createSubscription(array $params);
!!!
This method will automatically send an event to Subtruk and FbPixel
if you specified the correct settings ($subtruckParams, $fbPixelParams)
when calling the service
Get subscriptions
use Wowmaking\WebPurchases\Resources\Entities\Subscription;
$subscriptions = $webPurchases->getPurchasesClient()->getSubscriptions(string $customerId);
Cancel subscription
use Wowmaking\WebPurchases\Resources\Entities\Subscription;
$subscriptions = $webPurchases->getPurchasesClient()->cancelSubscription(string $subscriptionId);