private void RunSample(string accessToken, OffAmazonPaymentsAddressConsentSample addressConsentSample) { /***************************************************************** * Get the order reference details without address consent token *****************************************************************/ String gorWithoutConsent = addressConsentSample.GetOrderReferenceDetailsWithoutConsent(); if (gorWithoutConsent == null) { throw new OffAmazonPaymentsServiceException("The response from GetOrderReferenceDetailsWithoutConsent was null"); } /****************************************************************** * Get the order reference details with the consent token - this * response will contain additional information about the customer * comparsed to the previous response. * ****************************************************************/ String gorWithConsent = addressConsentSample.GetOrderReferenceDetailsWithConsent(Server.UrlDecode(accessToken)); if (gorWithConsent == null) { throw new OffAmazonPaymentsServiceException("The response from GetOrderReferenceDetailsWithoutConsent was null"); } ltOrderDetailsNoConsent.Text += formatStringForDisplay(gorWithoutConsent); ltOrderDetailsWithConsent.Text += formatStringForDisplay(gorWithConsent); }
/// <summary> /// Handle the form submisson /// </summary> /// <param name="sender">reference to the sender</param> /// <param name="e">arguments for the event</param> protected void btn_submit_Click(object sender, EventArgs e) { string orderReferenceId = tb_ORId.Text; string accessToken = tb_AccessToken.Text; OffAmazonPaymentsAddressConsentSample addressConsentSample = new OffAmazonPaymentsAddressConsentSample(orderReferenceId); RunSample(accessToken, addressConsentSample); }