Stripe-iOS backend method in Django to create ephemeral key?Creating a JSON response using Django and PythonStripe: error messages when Creating a Customer &/or Charge - Ruby on RailsDjango Stripe API Key IssuesStripe Bad Request ErrorStripe cannot create Ephemeral KeyStripe Payment: Customer cus_***** does not have a linked card with ID card_*****Stripe with Firebase doesn't seem to find the ephemeral keysError 400 with Stripe iOS PaymentAndroid Stripe app crashes on adding new payment sourceStripe Integration with Parse

Why does nature favour the Laplacian?

Why did C use the -> operator instead of reusing the . operator?

Is there a way to generate a list of distinct numbers such that no two subsets ever have an equal sum?

a sore throat vs a strep throat vs strep throat

I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?

Critique of timeline aesthetic

Elements other than carbon that can form many different compounds by bonding to themselves?

Can we say “you can pay when the order gets ready”?

Can SQL Server create collisions in system generated constraint names?

How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?

Does a large simulator bay have standard public address announcements?

Why do games have consumables?

What are the steps to solving this definite integral?

How can I practically buy stocks?

How to stop co-workers from teasing me because I know Russian?

Aligning equation numbers vertically

Extension of 2-adic valuation to the real numbers

Was there a shared-world project before "Thieves World"?

555 timer FM transmitter

Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?

How much cash can I safely carry into the USA and avoid civil forfeiture?

How to limit Drive Letters Windows assigns to new removable USB drives

Why must Chinese maps be obfuscated?

Relationship between strut and baselineskip



Stripe-iOS backend method in Django to create ephemeral key?


Creating a JSON response using Django and PythonStripe: error messages when Creating a Customer &/or Charge - Ruby on RailsDjango Stripe API Key IssuesStripe Bad Request ErrorStripe cannot create Ephemeral KeyStripe Payment: Customer cus_***** does not have a linked card with ID card_*****Stripe with Firebase doesn't seem to find the ephemeral keysError 400 with Stripe iOS PaymentAndroid Stripe app crashes on adding new payment sourceStripe Integration with Parse






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I've been following Standard iOS Integration Guide of Stripe for my iOS app, which uses a backend written in Python-Django, to issue an ephemeral key.



This is the function I came up with in my views.py:



import stripe

stripe.api_key = "sk_test_Xf1yJ9qESRcCliM9iLoRmCIW"

def issue_key(request):
if request.method == 'POST':
api_version = request.POST.get('api_version')
customerId = request.session['customerId']
key = stripe.EphemeralKey.create(customer=customerId, api_version=api_version)
return JsonResponse('key': key)
else:
return redirect("home:feed")


In my iOS app, I copied all the files from stripe-ios Standard Integration and filled in stripePublishableKey and backendBaseURL accordingly.



I'm also successfully creating a Stripe customer when a new user registers to my app, through Firebase Cloud Functions.



However, when CheckoutViewController loads, I get "Response status code was unacceptable: 404" error.



Assuming this error occurs while returning a JSON response from my backend, what is the correct code for the above method? Or am I missing something else on the Swift side?



Any suggestion or feedback will be welcomed and greatly appreciated.



Thank you.










share|improve this question






















  • You really shouldn't share secret keys on any public forum. Even if they are test keys. As for your issue, you should try to add more logging in your backend to see what is going on.

    – Paul Asjes
    Mar 25 at 3:27












  • Thanks for the feedback Paul. You are right about the secret key, but the key above is not the real one. I debugged further and the call doesn't hit my backend server: issue_key() doesn't run when CheckoutViewController loads. My backend base URL is steerr.com/issue-key. Any idea why?

    – steerr
    Mar 25 at 17:07












  • Sounds like a routing problem. I'd check your backend framework and make sure that you've set it up correctly. As for the secret key, even a test key is dangerous to have in public as it allows malicious people to mess with your test data. If I were you I'd edit your question and remove the key entirely.

    – Paul Asjes
    Mar 26 at 4:41

















0















I've been following Standard iOS Integration Guide of Stripe for my iOS app, which uses a backend written in Python-Django, to issue an ephemeral key.



This is the function I came up with in my views.py:



import stripe

stripe.api_key = "sk_test_Xf1yJ9qESRcCliM9iLoRmCIW"

def issue_key(request):
if request.method == 'POST':
api_version = request.POST.get('api_version')
customerId = request.session['customerId']
key = stripe.EphemeralKey.create(customer=customerId, api_version=api_version)
return JsonResponse('key': key)
else:
return redirect("home:feed")


In my iOS app, I copied all the files from stripe-ios Standard Integration and filled in stripePublishableKey and backendBaseURL accordingly.



I'm also successfully creating a Stripe customer when a new user registers to my app, through Firebase Cloud Functions.



However, when CheckoutViewController loads, I get "Response status code was unacceptable: 404" error.



Assuming this error occurs while returning a JSON response from my backend, what is the correct code for the above method? Or am I missing something else on the Swift side?



Any suggestion or feedback will be welcomed and greatly appreciated.



Thank you.










share|improve this question






















  • You really shouldn't share secret keys on any public forum. Even if they are test keys. As for your issue, you should try to add more logging in your backend to see what is going on.

    – Paul Asjes
    Mar 25 at 3:27












  • Thanks for the feedback Paul. You are right about the secret key, but the key above is not the real one. I debugged further and the call doesn't hit my backend server: issue_key() doesn't run when CheckoutViewController loads. My backend base URL is steerr.com/issue-key. Any idea why?

    – steerr
    Mar 25 at 17:07












  • Sounds like a routing problem. I'd check your backend framework and make sure that you've set it up correctly. As for the secret key, even a test key is dangerous to have in public as it allows malicious people to mess with your test data. If I were you I'd edit your question and remove the key entirely.

    – Paul Asjes
    Mar 26 at 4:41













0












0








0








I've been following Standard iOS Integration Guide of Stripe for my iOS app, which uses a backend written in Python-Django, to issue an ephemeral key.



This is the function I came up with in my views.py:



import stripe

stripe.api_key = "sk_test_Xf1yJ9qESRcCliM9iLoRmCIW"

def issue_key(request):
if request.method == 'POST':
api_version = request.POST.get('api_version')
customerId = request.session['customerId']
key = stripe.EphemeralKey.create(customer=customerId, api_version=api_version)
return JsonResponse('key': key)
else:
return redirect("home:feed")


In my iOS app, I copied all the files from stripe-ios Standard Integration and filled in stripePublishableKey and backendBaseURL accordingly.



I'm also successfully creating a Stripe customer when a new user registers to my app, through Firebase Cloud Functions.



However, when CheckoutViewController loads, I get "Response status code was unacceptable: 404" error.



Assuming this error occurs while returning a JSON response from my backend, what is the correct code for the above method? Or am I missing something else on the Swift side?



Any suggestion or feedback will be welcomed and greatly appreciated.



Thank you.










share|improve this question














I've been following Standard iOS Integration Guide of Stripe for my iOS app, which uses a backend written in Python-Django, to issue an ephemeral key.



This is the function I came up with in my views.py:



import stripe

stripe.api_key = "sk_test_Xf1yJ9qESRcCliM9iLoRmCIW"

def issue_key(request):
if request.method == 'POST':
api_version = request.POST.get('api_version')
customerId = request.session['customerId']
key = stripe.EphemeralKey.create(customer=customerId, api_version=api_version)
return JsonResponse('key': key)
else:
return redirect("home:feed")


In my iOS app, I copied all the files from stripe-ios Standard Integration and filled in stripePublishableKey and backendBaseURL accordingly.



I'm also successfully creating a Stripe customer when a new user registers to my app, through Firebase Cloud Functions.



However, when CheckoutViewController loads, I get "Response status code was unacceptable: 404" error.



Assuming this error occurs while returning a JSON response from my backend, what is the correct code for the above method? Or am I missing something else on the Swift side?



Any suggestion or feedback will be welcomed and greatly appreciated.



Thank you.







python ios swift django stripe-payments






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 17:13









steerrsteerr

3118




3118












  • You really shouldn't share secret keys on any public forum. Even if they are test keys. As for your issue, you should try to add more logging in your backend to see what is going on.

    – Paul Asjes
    Mar 25 at 3:27












  • Thanks for the feedback Paul. You are right about the secret key, but the key above is not the real one. I debugged further and the call doesn't hit my backend server: issue_key() doesn't run when CheckoutViewController loads. My backend base URL is steerr.com/issue-key. Any idea why?

    – steerr
    Mar 25 at 17:07












  • Sounds like a routing problem. I'd check your backend framework and make sure that you've set it up correctly. As for the secret key, even a test key is dangerous to have in public as it allows malicious people to mess with your test data. If I were you I'd edit your question and remove the key entirely.

    – Paul Asjes
    Mar 26 at 4:41

















  • You really shouldn't share secret keys on any public forum. Even if they are test keys. As for your issue, you should try to add more logging in your backend to see what is going on.

    – Paul Asjes
    Mar 25 at 3:27












  • Thanks for the feedback Paul. You are right about the secret key, but the key above is not the real one. I debugged further and the call doesn't hit my backend server: issue_key() doesn't run when CheckoutViewController loads. My backend base URL is steerr.com/issue-key. Any idea why?

    – steerr
    Mar 25 at 17:07












  • Sounds like a routing problem. I'd check your backend framework and make sure that you've set it up correctly. As for the secret key, even a test key is dangerous to have in public as it allows malicious people to mess with your test data. If I were you I'd edit your question and remove the key entirely.

    – Paul Asjes
    Mar 26 at 4:41
















You really shouldn't share secret keys on any public forum. Even if they are test keys. As for your issue, you should try to add more logging in your backend to see what is going on.

– Paul Asjes
Mar 25 at 3:27






You really shouldn't share secret keys on any public forum. Even if they are test keys. As for your issue, you should try to add more logging in your backend to see what is going on.

– Paul Asjes
Mar 25 at 3:27














Thanks for the feedback Paul. You are right about the secret key, but the key above is not the real one. I debugged further and the call doesn't hit my backend server: issue_key() doesn't run when CheckoutViewController loads. My backend base URL is steerr.com/issue-key. Any idea why?

– steerr
Mar 25 at 17:07






Thanks for the feedback Paul. You are right about the secret key, but the key above is not the real one. I debugged further and the call doesn't hit my backend server: issue_key() doesn't run when CheckoutViewController loads. My backend base URL is steerr.com/issue-key. Any idea why?

– steerr
Mar 25 at 17:07














Sounds like a routing problem. I'd check your backend framework and make sure that you've set it up correctly. As for the secret key, even a test key is dangerous to have in public as it allows malicious people to mess with your test data. If I were you I'd edit your question and remove the key entirely.

– Paul Asjes
Mar 26 at 4:41





Sounds like a routing problem. I'd check your backend framework and make sure that you've set it up correctly. As for the secret key, even a test key is dangerous to have in public as it allows malicious people to mess with your test data. If I were you I'd edit your question and remove the key entirely.

– Paul Asjes
Mar 26 at 4:41












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55304703%2fstripe-ios-backend-method-in-django-to-create-ephemeral-key%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55304703%2fstripe-ios-backend-method-in-django-to-create-ephemeral-key%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현