#AntonioT
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Can you provide a little. more description of what is going on here?
- What is the difference in behavior you are seeing?
- What is the difference between Test & Live environments?
- in test environment the subscription is created once the user authorice the payment, but in production when a user scan the qr code the subscription is not created
- by test & live environment im talkin about the switch that you have to be able to make test on our integrations
I didn't mean Stripe's test & live mode, I meant the code & hosting environment for your production app vs staging
is the same code that i have, the thing that change is the keys that im using
And the hosting environment is the same?
Do you have examples of the Subscription creation request for both test & live so I can check?
yes
sure
params := url.Values{}
params.Add("confirm", `true`)
params.Add("customer", customerID)
params.Add("payment_method_data[type]", `alipay`)
params.Add("metadata[price_id]", priceID)
params.Add("metadata[uuid_user]", uuidUser)
params.Add("metadata[plan]", "personal")
params.Add("payment_method_options[alipay][currency]", `usd`)
params.Add("payment_method_types[]", `alipay`)
params.Add("usage", `off_session`)
params.Add("mandate_data[customer_acceptance][type]", `online`)
params.Add("mandate_data[customer_acceptance][online][ip_address]", ipAddress)
params.Add("mandate_data[customer_acceptance][online][user_agent]", userAgent)
params.Add("return_url", redirectURL)
body := strings.NewReader(params.Encode())
req, err := http.NewRequest("POST", "https://api.stripe.com/v1/setup_intents", body)
if err != nil {
log.Println(err)
return "", err
}
req.SetBasicAuth(key, "")
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Println(err)
return "", err
}
defer resp.Body.Close()
bodyBytes, err := ioutil.ReadAll(resp.Body)
that is the code that im using to create a recurrent payment, in test environment that creates a subscription
but in live it doesnt and i not sure why
is the same code in live and test
Thanks for this. What I will need next is the request IDs for the successful (test) and unsuccessful(live) subscription creatioin requests.
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
this is req_zFUaEZZSaCrTzQ a test one
that creates a subscription
req_jnJanke6TZQohg and not sure why but in this one it doesnt create a subscription
Great, thanks!
Okay the first request is to /v1/subscriptions to create a Subscription. The second request is to /v1/setup_intents to create a Setup Intent
mmmmm
the thing is that
the first one
also creates the subscription
but the second one
the flow stop
on the setup intent
not sure why
if is the same code on both
The setup intent reaches a status of requires_action where the customer needs to authetnticate with alipay.
It then succeeds async
No worries! It's why we are here ๐
Happy to help ๐