简体   繁体   中英

How can I add new credit card to the existing shopper in Blusesnap

I have an existing "vaulted shopper" on the backend, who already has 2 or 3 credit cards. Now I would like to add another credit card via my Android app. I don't want to create new order, just add new credit card.

I'm using their component for input credit card com.bluesnap.androidapi.views.components.OneLineCCEditComponent. When I enter credit card number, I see a request to the Bluesnap backend: Tokenizing card on token BluesnapToken{url=' https://sandbox.bluesnap.com/services/2/ 'production='false', merchantToken='...'} The strange thing is that I don't see and requests after entering expiration date and cvv code.

At the end I create request to my backend with token, which I got at the beginning from Bluesnap, and I get the following error: "Seller 100500 encountered a problem creating a new shopper due to incorrect input. "

from what i understand you are trying to update vaulted shopper, to do this you need to do 3 things:

1) pair shopperId and token: according to BlueSnap documentation when creating a token you need to pair it to a shopperId: payment-fields-tokens?shopperId=XXXXXXXX

2) submitTokenizedDetails - if you are using BlueSnap Android SDK as an API/Component Based SDK you need to activate the bluesnapService.submitTokenizedDetails function in order to put the details to the Bluesnap backend. according to the SDK this function Update details on the BlueSnap Server

3) update vaulted shopper: to update vaulted shopper you need to use PUT request to https://sandbox.bluesnap.com/services/2/vaulted-shoppers/xxxxxxxx as stated in the documentation PUT request with Hosted Payment Fields token

    curl -v -X PUT https://sandbox.bluesnap.com/services/2/vaulted-shoppers/xxxxxxxx
-H 'Content-Type: application/json' 
-H 'Accept: application/json'  
-H 'Authorization: Basic Authorization' 
-d '
{
    "paymentSources": {"creditCardInfo": [{
         "pfToken": "TOKEN STRING"
    }]},
    "firstName": "FirstName",
    "lastName": "LastName",
    "vaultedShopperId": xxxxxxxx
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM