protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { string token = Request.QueryString["token"]; // build getdetails request GetExpressCheckoutDetailsReq req = new GetExpressCheckoutDetailsReq() { GetExpressCheckoutDetailsRequest = new GetExpressCheckoutDetailsRequestType() { Version = UtilPayPalAPI.Version, Token = token } }; // query PayPal for transaction details GetExpressCheckoutDetailsResponseType resp = UtilPayPalAPI.BuildPayPalWebservice().GetExpressCheckoutDetails(req); UtilPayPalAPI.HandleError(resp); GetExpressCheckoutDetailsResponseDetailsType respDetails = resp.GetExpressCheckoutDetailsResponseDetails; // setup UI and save transaction details to session Label1.Text = string.Format( "Dear {0} {1}, everything is set for {2} {3} transaction to take place. Click on button below to commit transaction", respDetails.PayerInfo.PayerName.FirstName, respDetails.PayerInfo.PayerName.LastName, respDetails.PaymentDetails.OrderTotal.Value, respDetails.PaymentDetails.OrderTotal.currencyID ); Session["CheckoutDetails"] = resp; } }
/// <remarks/> public void GetExpressCheckoutDetailsAsync(GetExpressCheckoutDetailsReq GetExpressCheckoutDetailsReq, object userState) { if ((this.GetExpressCheckoutDetailsOperationCompleted == null)) { this.GetExpressCheckoutDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExpressCheckoutDetailsOperationCompleted); } this.InvokeAsync("GetExpressCheckoutDetails", new object[] { GetExpressCheckoutDetailsReq}, this.GetExpressCheckoutDetailsOperationCompleted, userState); }
/// <remarks/> public void GetExpressCheckoutDetailsAsync(GetExpressCheckoutDetailsReq GetExpressCheckoutDetailsReq) { this.GetExpressCheckoutDetailsAsync(GetExpressCheckoutDetailsReq, null); }