VivaPayments / API

Index of Viva Wallet open source projects on GitHub.
139 stars 162 forks source link

Try to get a token #2427

Closed pascalradelet closed 1 year ago

pascalradelet commented 1 year ago

I'm a programmer and i try to connect to a card terminal. First a try to get a token. I work with delphi. "var HTTPClient: TIdHTTP; RequestHeaders: TStringList; RequestParams: TStringList; ResponseContent: string; AuthHeaderValue: string; response: TCustomRESTResponse; SSL: TIdSSLIOHandlerSocketOpenSSL; begin HTTPClient := TIdHTTP.Create(nil); try AuthHeaderValue := TNetEncoding.Base64.Encode('zzzzzzzzzzzzzzzzzzzzzzzzzzz.apps.vivapayments.com:zzzzzzzzzzzzzzzzzzzzzzzzz'); SSL := TIdSSLIOHandlerSocketOpenSSL.Create(HTTPclient); SSL.SSLOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2]; HTTPClient.IOHandler := SSL;

httpclient.Request.CustomHeaders.Values['Content-Type'] := 'application/x-www-form-urlencoded';
httpclient.Request.CustomHeaders.Values['Authorization']:='Basic ' + AuthHeaderValue;
httpclient.Request.Contenttype := 'application/x-www-form-urlencoded';
RequestParams := TStringList.Create;
RequestParams.Add('grant_type=client_credentials');

try
  ResponseContent := HTTPClient.Post('https://demo-accounts.vivapayments.com/connect/token', RequestParams);
  // Handle the response content as needed...
except
  // Handle exceptions...
end;

RequestParams.Free;
RequestHeaders.Free;

finally HTTPClient.Free; end;"

but a receive always a exception : Bad request

could you help me

VivaWalletCustomerSupport commented 1 year ago

Hello @pascalradelet,

Thank you for your message. Kindly note that 400 error (Bad request) occur when a syntax error exists in your code. We would like to advise you to check your implementation for syntax errors.

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @pascalradelet,

We just wanted to follow up on the reply we sent yesterday. We were simply wondering if you read our response.

In any case this ticket will remain active for at least 24 hours, so that you can come back if you wish.

However, if you have any questions, please don't hesitate to reply here and we'd be happy to help!

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @pascalradelet,

This ticket will close for now. Please don't hesitate to raise a new ticket if you need further assistance.

Kind regards, Viva Wallet E-commerce Support Team

pascalradelet commented 1 year ago

Hello

I have verify. But It doesn't Work anyway.

------ Message d'origine ------ De "VivaWalletCustomerSupport" @.**@.>> À "VivaPayments/API" @.**@.>> Cc "Pascal Radelet" @.**@.>>; "Mention" @.**@.>> Date 10-08-23 14:56:36 Objet Re: [VivaPayments/API] Try to get a token (Issue #2427)

Hello @pascalradelethttps://github.com/pascalradelet,

We just wanted to follow up on the reply we sent yesterday. We were simply wondering if you read our response.

In any case this ticket will remain active for at least 24 hours, so that you can come back if you wish.

However, if you have any questions, please don't hesitate to reply here and we'd be happy to help!

Kind regards, Viva Wallet E-commerce Support Team

— Reply to this email directly, view it on GitHubhttps://github.com/VivaPayments/API/issues/2427#issuecomment-1673169472, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BB2BOZOSV56D54IUU3CZ3DDXUTLAJANCNFSM6AAAAAA3JYHLIM. You are receiving this because you were mentioned.Message ID: @.***>