Using a Co-Branded UI Pipeline

You must direct your customers to the Amazon FPS Co-branded UI pipeline where they can set up payment authorizations required for your transaction. To direct your customers to the Amazon FPS Co-branded UI pipeline you must create a signed URL with parameters required for the payment authorization.

To build a co-branded UI request

  1. Construct a request URL using all the parameters and their values as per your use case. See the Amazon FPS Co-branded UI API reference for more information.

  2. Generate a signature using the Amazon FPS SigHelper tool and append it to the request URL using the awsSignature parameter. You can pass the unsigned URL and your secret key (associated with your AWS developer account) to the SigHelper tool to generate a signed URL. The SigHelper tool uses the steps described below in the Signing A URL topic to sign a URL. The SigHelper code samples are available for various lanaguages in the Community code category of the Amazon FPS Resource Center.

    [Note]Note
    After you extract the library or sample applications package from the Amazon FPS Resource center, go to the srcfolder to locate the SigHelpercode samples.

Signing A URL

Information transferred between a merchant web site and the Amazon FPS co-branded UI pipeline are secured using signed URLs. For example, the fictitious company DigitalDownload constructs the following URL using the parameters and values required for its use case.

https://authorize.payments-sandbox.amazon.com/cobranded-ui/actions/start?transactionAmount=10&callerReference=BL316
&pipelineName=SingleUse&recipientToken=SBDKWLL83932LDKDLAKSKSSKKKLL891919ASKDFSS&callerKey=11RLBBGBROL2006
&returnURL=http%3A%2F%2Fwww.digitaldownload-web-site.com%3ForderId%3D1234%26customerId%3Dxyz123
[Important]Important

Ensure that you URL encode the values in parameter=value strings as specified in RFC1738, section 2.2.

To sign a URL, you must do the following:

  1. Sort the query parameters

  2. Create a URL signature

Sorting the Query String

You must sort the parameters alphabetically as shown in the comparison of unsorted and sorted parameters below:

Unsorted Parameters

transactionAmount=10&callerReference=BL316&pipelineName=SingleUse&recipientToken=SBDKWLL83932LDKDLAKSKSSKKKLL891919ASKDFSS
&callerKey=11RLBBGBROL2006&returnURL=http%3A%2F%2Fwww.digitaldownload-web-site.com%3ForderId%3D1234%26customerId%3Dxyz123
      

Sorted Parameters

callerKey=11RLBBGBROL2006&callerReference=BL316&pipelineName=SingleUse&recipientToken=SBDKWLL83932LDKDLAKSKSSKKKLL891919ASKDFSS
&returnURL=http%3A%2F%2Fwww.digitaldownload-web-site.com%3ForderId%3D1234%26customerId%3Dxyz123&transactionAmount=10
      

Creating URL Signature

You must do the following to create a URL signature:

  1. Compute a RFC 2104compliant HMAC signature of the sorted parametersstring appended to the path information.
    /cobranded-ui/actions/start?callerKey=11RLBBGBROL2006&callerReference=BL316&pipelineName=SingleUse
    &recipientToken=SBDKWLL83932LDKDLAKSKSSKKKLL891919ASKDFSS&returnURL=http%3A%2F%2Fwww.digitaldownload-web-site.com%3ForderId%3D1234%26customerId%3Dxyz123
    &transactionAmount=10
  2. Encode the resultant signature using Base64.
  3. URL encode (percent-encode) the resultant value.

Append this signature using the awsSignature parameter to your request URL to direct your customers to the Amazon FPS Co-branded UI pipeline. The final URL should resemble:

https://authorize.payments-sandbox.amazon.com/cobranded-ui/actions/start?transactionAmount=10&callerReference=BL316
&pipelineName=SingleUse&recipientToken=SBDKWLL83932LDKDLAKSKSSKKKLL891919ASKDFSS&callerKey=11RLBBGBROL2006
&returnURL=http%3A%2F%2Fwww.digitaldownload-web-site.com%3ForderId%3D1234%26customerId%3Dxyz123
&awsSignature=The signature created using the steps explained here.

See the Amazon FPS Getting Started Guide for more information.