hosted-fields/public/api.js
/**
 * A simple wrapper around calls to our app server which
 * will call the PayPal Orders API
 */
A simple wrapper around calls to our app server which
will call the PayPal Orders API
A simple wrapper around calls to our app server which will call the PayPal Orders API
function createOrder() {
  return fetch("/api/orders", {
    method: "post",
  }).then((res) => res.json());
}
function createOrder ( ) { return fetch ( "/api/orders" , { method : "post" , } ) . then ( ( res ) => res . json ( ) ) ; }
A simple wrapper around calls to our app server which
 will call the PayPal Orders API
A simple wrapper around calls to our app server which will call the PayPal Orders API
// use the "body" param to optionally pass additional order information like // product ids or amount.