Generating token in Stripe on server Side - ruby-on-rails

I want to create some tests to check my subscription failed processus.
At first I use a good working card (42...) and subscribe then I want to update the card of the Stripe Customer with the bad working card (40...4) to check the code of my webhook in case of failed subscription.
The problem I encounter, is to update a customer card, I should have a token, but my tests are written only server side (no javascript).
Is there any way to generate a token from server-side with Stripe?
Thanks in advance

Related

The verification could not be sent to NeverBounce

I am new at Zapier and trying to make an email verification using NeverBounce from Zapier and complete the following setup.
I create an app in NeverBounce.
I complete Trigger in steps in Zapier.
Completed the Action and logged in NeverBounce by IP key.
And finally, during testing, I get this error!
The verification could not be sent to NeverBounce.
The app returned `{"message":"We were unable to complete your request. Check our system status at https://twitter.com/neverbounceapi as their may be an issue with our system. The following information was supplied: Insufficient credit balance.
Here is an screen shoot of the error I am facing
Thanks for your help😊.
The error message says you don't have enough credits, you may want to check your account. Or this may be just a glitch with the test procedure and you may want to just proceed with the Zap and see if the actual run is successful.
As an alternative, you may want to switch to Verifalia instead, which not only includes daily credits even with its free plan but also allows to verify lists of email addresses through Zapier (in addition to single email verification).
Verifalia integrations: https://verifalia.com/integrations
Verifalia Zapier integration: https://zapier.com/apps/verifalia/integrations
Disclaimer: I work for Verifalia and have developed its Zapier integration.

No such token "some_random_token" found Stripe error in rails

I am using stripe in my app.
There is a function in in app which is used to create charge from card to company account registered in our site.
It usually works fine and all payments are completed but sometimes it says no such token found.
I am creating token just before creating charge and code is something like that:
token = Stripe:Token:Create({
customer: stripe_customer_id
}, company_stripe_secret_key).id
#please ignore the syntax or any error as it works fine and I am writing it on mobile
#purpose of code it to tell you that how follow works
And just after that I am creating charge and when charge request goes it returns no such token "token_returned_by_stripe"
How is it possible? Stripe is returning the token and I am using that token and it says no such token....???
Your code snippet there is cloning a Token from the Platform, on to the Connect account. You are most likely creating a Direct Charge (on the Connect account) after that code snippet.
There are a few reasons you would be getting this error, for example you could be cloning the Token on acct_1 but creating the Charge on acct_2, or not cloning at all but trying to use the Platform Token directly on a Connect account, etc.
But really it boils down to that your code has a Token on one account but is trying to use it on a different account. You should troubleshoot and debug your code by adding logs to see which Tokens are being created and on which account you try to create the Charge.

Rails Square API - `Authorization` http header of your request was malformed

I am building a Rails 5 app that submits a payment to square.
I have a form that post register info to my DB then calculates amounts to be charged to credit card.
I am using the Square SqPaymentForm found in the Payment Forms doc.
When I attempt to process the CC I am receiving an error saying malformated authorization token.
I am not sure how to even pass an authorization token and all the documents and example code I look at dose not indicate that I need to configure any header model, method, etc..
Any help or advice is welcomed please keep in mind that this is my first attempt to link a ROR ap to a third party API. Here is my Git to view my code.

Stripe card authentication passed from iPhone, failed on server

The card was validated by Stripe's iPhone code, where I create a card, send to their server and receive a stripe token.
When I charge that token, the server receives an error from Stripe saying invalid CVC.
I checked Zip code & CVC verification required in my account settings.
Is there a way to authenticate the credit card prior to charging it?
You can pre-validate any or all of the card data beforehand—check out the Validation section of the documentation.
To deal with ZIP code mismatches or incorrect CVV data, you'll have to implement appropriate error handling on both your server and client.
If you haven't worked with other payment processors before, this is not specific to Stripe. CVV is generated with private encryption keys and can only be verified by trusted parties (i.e. the issuing banks). The payment card industry's not in the habit of enabling brute force attacks, so you must actually post a charge to determine whether card validation data is correct.
There is no way to know the data is correct until you attempt a charge—if that charge is rejected for reasons of incorrect data, that's how you know it's incorrect. It's how the payment network functions, and it's how your application must function.

PayPal Sandbox - CreateBillingAgreement call returns Internal Error (10001)

I'd appreciate any help with this, I've run around in circles trying all sorts of combinations with the PayPal Api - but I'm hitting a brick wall on this one.
I'm looking to call the CreateBillingAgreement method but each time I do it fails and reports a 10001 'internal error' from paypal in the response.
I have a valid token and I'm using version 84.0. I've successfully called SetupExpressCheckout and DoExpressCheckout, both of which succeed and the payment goes through. I'm setting up a future payment / pre-authorisation on the SetupExpressCheckout and the user agrees to that no problems.
​Do I need to change settings on the merchant in the sandbox? Am I calling things in the wrong order maybe? (SetExpress, GetExpress, DoExpress, CreateBilling)?
​I'm looking to use this billing agreement to allow a reference transaction in the future. I'm having a test account 'pay' using paypal and not forwarding any credit card details, the payment is for a digital service with no delivery (no shipping is set, no addresses or delivery costs are involved). The overall goal is to provide a one-click re-order button, whereby no details need to be entered by the customer.
I'm using the C# api in asp.net 4, or more specifically I've created Service References from the paypal sandbox wsdl and I'm using those in asp.net.
​Any and all help is appreciated - thanks.
​Russell.
You don't need to call CreateBillingAgreement if you're specifying billingtype MerchantInitiatedBilling in your SetExpressCheckout and DoExpressCheckoutPayment API call. CreateBillingAgreement is only necessary if you don't want to call DoExpressCheckoutPayment.
If MerchantInitiatedBilling is set, DoExpressCheckoutPayment will already return a billing agreement ID, which you can use in DoReferenceTransaction.
I don't have access to an example at hand, but will update this post as soon as I've found one for you.

Resources