オブジェクトの更新はオブジェクトの作成に似ています。次の 3 つのステップがあります。
- 更新オプションの設定
- StripeSDKMain 外部オブジェクトを使用したオブジェクトの更新
- 応答のロードまたはエラーの処理
また、オブジェクトの ID が必要です。API 呼び出しでパラメーターとして送信されます。
//更新オプションを設定
&StripeSubscriptionUpdateOptions.Customer = &CustomerId
&StripeSubscriptionUpdateOptions.Quantity = &SubscriptionQuantity
//API 呼び出しを実行
&JSON = &StripeSubscriptionUpdateOptions.ToJson()
&StripeSDKMain.UpdateSubscription(&Api_Key,&SubscriptionId,&JSON,&Response,&Errors,&ErrorCode)
//エラーを処理
if &ErrorCode = 0
&StripeSubscriptionUpdateResponse.FromJson(&Response)
Msg(&StripeSubscriptionUpdateResponse.ToJson())
&SubscriptionId = &StripeSubscriptionUpdateResponse.id
else
&StripeError.FromJson(&Errors)
Msg(&StripeError.ToJson())
EndIf
|