paypal/client_test.go

33 lines
1.0 KiB
Go
Raw Normal View History

2015-10-15 07:52:16 +02:00
package paypalsdk
import (
2015-12-22 06:09:57 +01:00
"fmt"
2015-10-30 08:02:32 +01:00
"testing"
2015-10-15 07:52:16 +02:00
)
2015-12-22 05:31:12 +01:00
// All test values are defined here
var testClientID = "AZgwu4yt5Ba0gyTu1dGBH3txHCJbMuFNvrmQxBaQbfDncDiCs6W_rwJD8Ir-0pZrN-_eq7n9zVd8Y-5f"
var testSecret = "EBzA1wRl5t73OMugOieDj_tI3vihfJmGl47ukQT-cpctooIzDu0K7IPESNC0cKodlLSOXzwI8qXSM0rd"
var testAuthID = "2DC87612EK520411B"
2015-12-22 06:09:57 +01:00
var testFakeAuthID = "FAKE-2DC87612EK520411B"
2015-12-22 05:31:12 +01:00
var testOrderID = "O-4J082351X3132253H"
2015-12-22 06:09:57 +01:00
var testFakeOrderID = "FAKE-O-4J082351X3132253H"
2015-12-22 05:31:12 +01:00
var testSaleID = "4CF18861HF410323U"
var testPaymentID = "PAY-5YK922393D847794YKER7MUI"
var testPayerID = "CR87QHB7JTRSC"
var testUserID = "https://www.paypal.com/webapps/auth/identity/user/WEssgRpQij92sE99_F9MImvQ8FPYgUEjrvCja2qH2H8"
2015-12-22 05:31:12 +01:00
2015-10-15 07:52:16 +02:00
func TestNewClient(t *testing.T) {
2015-10-30 08:02:32 +01:00
_, err := NewClient("", "", "")
if err == nil {
t.Errorf("All arguments are required in NewClient()")
2015-12-22 06:09:57 +01:00
} else {
fmt.Println(err.Error())
2015-10-30 08:02:32 +01:00
}
2015-12-22 05:31:12 +01:00
_, err = NewClient(testClientID, testSecret, APIBaseSandBox)
if err != nil {
2016-09-19 06:39:05 +02:00
t.Errorf("NewClient() must not return error for valid creds: %s", err.Error())
2015-12-22 05:31:12 +01:00
}
2015-10-15 07:52:16 +02:00
}