サブスクリプションを使用すると、顧客に定期的な請求ができます。顧客に特定のプランを固定できます。
サブスクリプションを作成するには、以下を使用します。
- オプションの作成: StripeSubscriptionCreateOptions
- 応答: StripeSubscriptionCreateResponse
- エラー: StripeError
サブスクリプションを更新するには、以下を使用します。
- オプションの更新: StripeSubscriptionUpdateOptions
- 応答: StripeSubscriptionUpdateResponse
- エラー: StripeError
サブスクリプションを取得するには、以下を使用します。
- 応答: StripeSubscriptionRetrieveResponse
- エラー: StripeError
サブスクリプションをキャンセルするには、以下を使用します。
- 応答: StripeSubscriptionCancelResponse
- エラー: StripeError
注: サブスクリプションをキャンセルする場合は、オプションのパラメーターを追加して、サブスクリプションをすぐに終了するか、次の請求期間の後に終了するかを決定できます。既定では、このパラメーターは False です。
&CancelAtPeriodEnd = True //次の (期間終了時に) 請求を行う場合は True
&StripeSDKMain.CancelSubscription(&Api_Key,&SubscriptionId,&CancelAtPeriodEnd,&Response,&Errors,&ErrorCode)
if &ErrorCode = 0
&StripeSubscriptionCancelResponse.FromJson(&Response)
Msg(&StripeSubscriptionCancelResponse.ToJson())
else
&StripeError.FromJson(&Errors)
Msg(&StripeError.ToJson())
EndIf
|