Subscription
4 years ago
PaymentGatewayInterface.php
4 years ago
PaymentGatewaysIterator.php
4 years ago
SubscriptionModuleInterface.php
4 years ago
SubscriptionModuleInterface.php
63 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Framework\PaymentGateways\Contracts; |
| 4 | |
| 5 | use Give\Donations\Models\Donation; |
| 6 | use Give\Framework\PaymentGateways\Commands\GatewayCommand; |
| 7 | use Give\PaymentGateways\DataTransferObjects\GatewayPaymentData; |
| 8 | use Give\PaymentGateways\DataTransferObjects\GatewaySubscriptionData; |
| 9 | use Give\Subscriptions\Models\Subscription; |
| 10 | |
| 11 | interface SubscriptionModuleInterface |
| 12 | { |
| 13 | /** |
| 14 | * Create a subscription with gateway |
| 15 | * |
| 16 | * @since 2.18.0 |
| 17 | * |
| 18 | * @param GatewayPaymentData $paymentData |
| 19 | * @param GatewaySubscriptionData $subscriptionData |
| 20 | * |
| 21 | * @return GatewayCommand |
| 22 | */ |
| 23 | public function createSubscription(GatewayPaymentData $paymentData, GatewaySubscriptionData $subscriptionData); |
| 24 | |
| 25 | /** |
| 26 | * Cancel subscription. |
| 27 | * |
| 28 | * @since 2.20.0 |
| 29 | * |
| 30 | * @param Subscription $subscription |
| 31 | * |
| 32 | * @return void |
| 33 | */ |
| 34 | public function cancelSubscription(Subscription $subscription); |
| 35 | |
| 36 | /** |
| 37 | * Returns whether the gateway supports syncing subscriptions. |
| 38 | * |
| 39 | * @since 2.20.0 |
| 40 | * |
| 41 | * @return bool |
| 42 | */ |
| 43 | public function canSyncSubscriptionWithPaymentGateway(); |
| 44 | |
| 45 | /** |
| 46 | * Whether the gateway supports updating subscription amount. |
| 47 | * |
| 48 | * @since 2.20.0 |
| 49 | * |
| 50 | * @return bool |
| 51 | */ |
| 52 | public function canUpdateSubscriptionAmount(); |
| 53 | |
| 54 | /** |
| 55 | * Whether the gateway supports updating subscription method. |
| 56 | * |
| 57 | * @since 2.20.0 |
| 58 | * |
| 59 | * @return bool |
| 60 | */ |
| 61 | public function canUpdateSubscriptionPaymentMethod(); |
| 62 | } |
| 63 |