Bambora Payment Service + React Application integration - redirect

I'm trying to set up a third party payment service with my React application.
https://developer.bambora.com/europe/sdk/web-sdk/checkout-integration
I'm trying to figure out how to send form data onSubmit as an object to pre-populate form fields on the Bambora redirect URL page.
I'm thinking that I have to create a state object, populate it onSubmit of the fields, if valid pass it to the RedirectCheckout() somehow. I'm not sure how to do that last part.
import { RedirectCheckout } from "#bambora/checkout-sdk-web";
....
new RedirectCheckout("<<YOUR-SESSION-TOKEN-HERE>>")

This was solved by using the checkout link generator from Bambora and creating a hash function using the params they used in their hash function for validation for the link.

Related

Customizing "PayPal" button for PayPal Marketplace (API)

I am developing my app with PayPal Marketplace API for the first time.
Among other steps, I need to customize a "PayPal checkout" button. I did this by following instructions on this page.
In function "payment" (see the original code segment below), I supposed to provide a call-back url for CREATE_URL:
// payment() is called when the button is clicked
payment: function() {
// Set up a url on your server to create the payment
var CREATE_URL = '/demo/checkout/api/paypal/order/create/';
// Make a call to your server to set up the payment
return paypal.request.post(CREATE_URL)
.then(function(res) {
return res.id;
});
}
By reading this, I am puzzled why the CREATE_URL value is not a fullpath url starting with "http" or "https"? I have the similar question for EXECUTE_URL in an ensuing segment of the html file.
What type of RequestBody should my REST controller expect?
What action should my app take at the url for "CREATE_URL"? My intuition is to call the Order API to create an order (among other things in my database). Is this correct?
I can address your questions one at a time:
By reading this, I am puzzled why the CREATE_URL value is not a fullpath url starting with "http" or "https"? I have the similar question for EXECUTE_URL in an ensuing segment of the html file.
You don't have to have a full path URL (known as absolute path) because the path that you provide for CREATE_URL is on your own server. So the code where you have your button is on a page like exampleButton.html and when you click the button, it takes you to a script, such as
var CREATE_URL = '/demo/checkout/api/paypal/order/create/';
which is an index page which will run the Create Order API method with the data that you pass. Here is another example implementing a payment button with checkout.js using a server side language.
What type of RequestBody should my REST controller expect?
Your request body will receive the payment data from the JavaScript data parameter, which should be JSON format. You then pass this to the server side when you receive the POST data.
An even simpler implementation is to use the client-side integration to create the order.
What action should my app take at the url for "CREATE_URL"? My intuition is to call the Order API to create an order (among other things in my database). Is this correct?
Your app should automatically run the create order method. This script works with JavaScript promises, so will wait for a response, like getting a successful authorization (or failure) from the customer before attempting to execute the payment.

Infusionsoft Form Submission API

I have been using Infusionsoft form embedded in html page but now I want to send data to Infusionsoft form using their API. I checked their APIs but could not figure out which one should be used to submit data to the Infusionsoft form. Can someone please help me with this?
https://developer.infusionsoft.com/docs/xml-rpc/
Thanks for looking into this.
Thank you, Naresh
Try to use REST API instead of XML RPC. Developer center already marked XML RPC to "legacy" module, and I guess they will replace "XML RPC" sooner or later.
Regarding to your question, you will need to define what data set you want to update.
For example, if your form is going to insert a new contact, you will need 2 things from your code.
First, prepare the parameters such like "email_addresses", "phone_numbers" and "given_name".
Second, POST request with parameters to this URL "https://api.infusionsoft.com/crm/rest/v1/contact?access_token=123abc" after authentication.
Ways to test:
Try REST API calls on page https://developer.infusionsoft.com/docs/rest/
Good luck.
To pull Webformvia API you will have to use following method, this will pull the HTML form:
Retrieve a Form's HTML
to submit a data to Infusionsoft via API
You will have to use Create contact and update contact API:
Create Contact
Update COntact
XML RPC is still in use but Infusionsoft suggests to use REST API methods
Create a Contact
Update a Contact
Single API call for two methods: Create or Update a Contact

Token is not getting a value when the form sent by email

I'm developing a basic recruitment-type website.
I have an "Apply" CustomForm attached with a contenttype("Job"), but I can't get access fields outside of the CustomForm widget. I'm trying to add the reference number or the url to the email within the workflow. Orchard shows {Content.Fields.Input-Reference} token, but it returns no value when used.
Should I overwrite the handler when the form is created or how can I access fields of other zones?
As far as I understand the question, you don't actually need to add a custom token to your module. Custom Forms module takes care of that for you and adds the tokens for fields itself. You just need to use them in the email module.
Just look for a tokens named like this:
Content.Fields.[FormContentTypeName].[FieldName]
Not that the tasks of adding custom tokens to the system and accessing them inside the workflow are particularly hard, mind you.

Allow form submission to server inside of angularJS?

According to the AngularJS doc's https://docs.angularjs.org/api/ng/directive/form
"For this reason, Angular prevents the default action (form submission to the server) unless the element has an action attribute specified."
is there any way to stop angularJS doing this?
If you don't want the form submission to go down the browser handled route don't put the action attribute on the form use the directive ng-submit which basically calls a method on your controller which will allow you to send the data to the server via a xhr request.

issue in Zend_Frame_ Select box validation in ajax call

i have created a country select box as
$country= new Zend_Form_Element_Select('country');
in my user registration form ..
While selecting an country an ajax call is send and getting the state list
by creating another select box
$state= new Zend_Form_Element_Select('state');
in another action say stateAction()
Problem is that when i tried to validate registration form in the POST action
i cant retrieve the value from state
$form = new Users_Form_Register();
eg as $userObjectDetails->statename=$form->getValue('state');
as a solution i added tried to added a dummy variable $state in Users_Form_Register();
add addElement($state),unfortunately during value is loaded by ajax call the state list issue occure during validation of the form
please suggest a solution for the above
Thank you
You could try validating with javascript. jQuery has a nice validation plugin that lets you attach the validator to the form ID and define the rules you want to validate.