project/app/scripts/modules/payment-api.js
/*
  * Given a cart set up with an order, gets payment authorization.
  * Returns a promise that resolves when payment is complete, this
  * has a data object you can pass to the back-end payment server.
  */
Given a cart set up with an order, gets payment authorization.
Returns a promise that resolves when payment is complete, this
has a data object you can pass to the back-end payment server.
Given a cart set up with an order gets payment authorization . Returns a promise that resolves when payment is complete this has a data object you can pass to the back - end payment server .
checkout(cart) {
    let request = this.buildPaymentRequest(cart);
    let response;
    return 
      ;
  }
checkout ( cart ) { let request = this . buildPaymentRequest ( cart ) ; let response ; return }
Given a cart set up with an order, gets payment authorization.
Given a cart set up with an order gets payment authorization .
// Show UI then continue with user payment info // TODO PAY-6 - display the PaymentRequest // .then(r => { //   response = r; //   // Extract just the details we want to send to the server //   var data = this.copy(response, 'methodName', 'details', 'payerEmail', //     'payerPhone', 'shippingOption'); //   data.address = this.copy(response.shippingAddress, 'country', 'region', //     'city', 'dependentLocality', 'addressLine', 'postalCode', //     'sortingCode', 'languageCode', 'organization', 'recipient', 'careOf', //     'phone'); //   return data; // }) // .then(sendToServer) // .then(() => { //   response.complete('success'); // }) // .catch(e => { //   if (response) response.complete(`fail: ${e}`); // });