public NameValueCollection SetExpressCheckout(Address shipToAddress,OrderDetails orderDetails, string cancelUrl, string confirmationUrl) { var request = SetExpressCheckout(orderDetails,cancelUrl,confirmationUrl); addAddressValues(shipToAddress, request); return request; }
public PayPalExpressCheckoutToken SetExpressCheckout(Address shipToAddress, OrderDetails orderDetails, string cancelUrl, string confirmationUrl) { if (shipToAddress == null) throw new ArgumentNullException("shipToAddress"); if (orderDetails == null) throw new ArgumentNullException("orderDetails"); if (string.IsNullOrWhiteSpace(cancelUrl)) throw new ArgumentNullException("cancelUrl"); if (string.IsNullOrWhiteSpace(confirmationUrl)) throw new ArgumentNullException("confirmationUrl"); _logger.Log("SetExpressCheckout.Request", new { ShipToAddress = shipToAddress,OrderDetails = orderDetails, CancelUrl = cancelUrl, ConfirmationUrl = confirmationUrl }); var request = _requestBuilder.SetExpressCheckout(shipToAddress,orderDetails, cancelUrl, confirmationUrl); return setExpressCheckoutRequestFor(request); }
void addAddressValues(Address address,NameValueCollection request) { addOptionalValueToRequest("PAYMENTREQUEST_0_SHIPTONAME", address.Name, request); addOptionalValueToRequest("PAYMENTREQUEST_0_SHIPTOSTREET", address.Street1, request); addOptionalValueToRequest("PAYMENTREQUEST_0_SHIPTOSTREET2", address.Street2, request); addOptionalValueToRequest("PAYMENTREQUEST_0_SHIPTOCITY", address.City, request); addOptionalValueToRequest("PAYMENTREQUEST_0_SHIPTOSTATE", address.State, request); addOptionalValueToRequest("PAYMENTREQUEST_0_SHIPTOZIP", address.Zip, request); addOptionalValueToRequest("PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE", address.CountryCode, request); addOptionalValueToRequest("PAYMENTREQUEST_0_SHIPTOPHONENUM", address.PhoneNumber, request); }