Page 1 of 1

Throwing HTML Text Responses to Appery.io Components

Posted: Sat Sep 26, 2015 3:39 pm
by Victor Strausbaugh

I am using Stripe.js in an HTML form to obtain a token for user's bank accounts. After the users submit their bank account info inside the HTML form, the token comes back appended to the HTML form. I want to be able to throw the token into an Appery.io label component (or lsv) so that I can save it to my database. Any thoughts?

Image Image


Throwing HTML Text Responses to Appery.io Components

Posted: Sat Sep 26, 2015 3:40 pm
by Victor Strausbaugh

Here is the HTML code for the form...

<!-- The required Stripe lib --

<!-- jQuery is used only for this example; it isn't required to use Stripe --

').val(token));
console.log(response);

Code: Select all

 } 

};

// Now the handler is done, lets use it when the form is submitted.
// On form submission execute:
jQuery(function($) {
$('#inst-form').submit(function(event) {
// Get the form object.
var $form = $(this);
// Disable the submit button to prevent repeated clicks
$form.find('button').prop('disabled', true);
// Create a token with Stripe
Stripe.bankAccount.createToken($form, stripeResponseHandler);
// Prevent the form from submitting with the default action
return false;
});
});

Give us your bank info

Code: Select all

     spanBank Location/span 

             United States 

     spanRouting Number/span 

     spanAccount Number/span 

 Make Recipient!

Throwing HTML Text Responses to Appery.io Components

Posted: Sat Sep 26, 2015 3:42 pm
by Victor Strausbaugh

Stripe.setPublishableKey('[blankedout]');
var stripeResponseHandler = function(status, response) {
var $form = $('#inst-form');
if (response.error)
{
alert("Error");
// Not sure how to get these errors.
$form.find('button').prop('disabled', false);
}
else
{
var token = response.id;

Code: Select all

   $form.append($('').val(token)); 
   console.log(response); 

 } 

};

jQuery(function($) {
$('#inst-form').submit(function(event) {
// Get the form object.
var $form = $(this);
// Disable the submit button to prevent repeated clicks
$form.find('button').prop('disabled', true);
// Create a token with Stripe
Stripe.bankAccount.createToken($form, stripeResponseHandler);
// Prevent the form from submitting with the default action
return false;
});
});


Throwing HTML Text Responses to Appery.io Components

Posted: Mon Sep 28, 2015 7:32 am
by Serhii Kulibaba

Hello Victor,

Could you clarify, did you use stripe plugin? https://devcenter.appery.io/documenta...


Throwing HTML Text Responses to Appery.io Components

Posted: Tue Sep 29, 2015 2:30 pm
by Victor Strausbaugh

I am only using the Stripe plug-in to charge my merchant's customers credit cards, but that's it. Since I'm using Stripe Connect to connect merchants, I need to be able to tokenize each merchants bank account then associate that to their managed Stripe account. This functionality is additional to what the Stripe plug-in offers... The Appery Stripe plug-in only provides a service if I were selling directly to buyers... But since I'm not selling directly to buyers - it's my merchants that are selling using 'managed accounts' I need to be able to do additional tokenization.

When I try to tokenize their bank account, I am able to create the token, but after the tokenization process completes, the rest of the Appery jQuery components are disabled.... Meaning I can't put the token into a LSV or navigate away the page or anything else

Here is an update of how it looks now... When I click the "Done" button, it is suppose to navigate to a different page and update my Appery DB collection with the token.... But nothing happens

Image Image Image Image


Throwing HTML Text Responses to Appery.io Components

Posted: Sat Oct 10, 2015 7:27 pm
by Serhii Kulibaba

Unfortunately custom logic is something outside the scope of standard Appery.io platform support. You may consider purchasing Advisory Pack to get more in-depth help on this question. Here is more information about Advisory Pack (http://appery.io/services/#Advisory_Pack).