amzn / amazon-pay-sdk-samples

Amazon Pay SDK Sample Code
Apache License 2.0
43 stars 32 forks source link

Transactions from made from a billing agreement should return the billing agreement id #19

Closed djone010 closed 6 years ago

djone010 commented 6 years ago

Hopefully this is the correct place for this bug because I cannot find a good place to report it. I have opened a case through amazon pay help, but the customer service is not well trained on amazon pay issues.

I recently had a case where a customer changed his email address with amazon pay, and I could not find his billing agreement on my end because of this. The amazon pay seller central does not show us a list of customers and their billing agreements like paypal does, and amazon customer service cannot look up the billing agreement that an Amazon Reference ID came from either. The only work around I can see, is to use the billing agreement ID as the Seller Order ID when making the transaction so that we can know this information looking at Manage Transactions in seller central. It seems like an easy thing for amazon to mirror how paypal shows us a list of our customers and their billing agreements.

Thanks.

bjguillot commented 6 years ago

If you know the Order Reference ID (P0n-nnn-nnn or S0n-nnn-nnn for Sandbox) You can obtain the parent Billing Agreement ID via the GetOrderReferenceDetails API call.

An example response might look like:

  <GetOrderReferenceDetailsResult>
    <OrderReferenceDetails>
      <OrderReferenceStatus>
        <LastUpdateTimestamp>2018-05-28T13:58:46.278Z</LastUpdateTimestamp>
        <State>Canceled</State>
        <ReasonCode>SellerCanceled</ReasonCode>
      </OrderReferenceStatus>
      <Destination>
        <DestinationType>Physical</DestinationType>
        <PhysicalDestination>*** Removed ***</PhysicalDestination>
      </Destination>
      <ExpirationTimestamp>2018-11-24T13:58:45.469Z</ExpirationTimestamp>
      <IdList/>
      <ParentDetails>
        <Type>BillingAgreement</Type>
        <Id>C01-4828023-1699072</Id>
      </ParentDetails>
      <SellerOrderAttributes>
        <StoreName>My Store Name</StoreName>
        <CustomInformation>My Custom Information</CustomInformation>
        <SellerOrderId>MySellerBillingAgreementID</SellerOrderId>
      </SellerOrderAttributes>
      <OrderTotal>
        <CurrencyCode>USD</CurrencyCode>
        <Amount>0.01</Amount>
      </OrderTotal>
      <Buyer>*** Removed ***</Buyer>
      <ReleaseEnvironment>Sandbox</ReleaseEnvironment>
      <SellerNote>*** Removed ***</SellerNote>
      <AmazonOrderReferenceId>S01-4434296-8525019</AmazonOrderReferenceId>
      <CreationTimestamp>2018-05-28T13:58:45.469Z</CreationTimestamp>
      <RequestPaymentAuthorization>false</RequestPaymentAuthorization>
    </OrderReferenceDetails>
  </GetOrderReferenceDetailsResult>

Note the "ParentDetails" node, particularly that C01-4828023-1699072 ID in the example above. That would be the Billing Agreement ID (uses C0n-nnn-nnn in Sandbox versus B0n-nnn-nnn in Production).

Since you posted here, I assume you are a developer and are able to write code to make the GetOrderReferenceDetails API call using one of our SDKs, but if you are not a developer, you can make the same API call using the MWS Scratchpad here without doing any programming: https://mws.amazonservices.com/scratchpad/index.html

As you noticed, there is currently no mechanism in the Seller Central web interface to obtain the parent the Billing Agreement ID. I'll pass your suggestion along to the team.

djone010 commented 6 years ago

Thanks that is what I was looking for! Yes, it would be nice to have a mechanism in seller central or for a support agent to be able to look up the information.