-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathreceipt_test.go
17 lines (15 loc) · 7.09 KB
/
receipt_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package apple_test
import (
"github.com/smartwalle/apple"
"testing"
)
func TestVerifyReceipt(t *testing.T) {
var summary, info, err = apple.VerifyReceipt("460001400577115", "MIIUTAYJKoZIhvcNAQcCoIIUPTCCFDkCAQExCzAJBgUrDgMCGgUAMIIDigYJKoZIhvcNAQcBoIIDewSCA3cxggNzMAoCARQCAQEEAgwAMAsCARkCAQEEAwIBAzAMAgEOAgEBBAQCAgD9MA0CAQMCAQEEBQwDMzI1MA0CAQoCAQEEBRYDMTcrMA0CAQsCAQEEBQIDGcsNMA0CAQ0CAQEEBQIDAkuBMA0CARMCAQEEBQwDMzI1MA4CAQECAQEEBgIESzWz9zAOAgEJAgEBBAYCBFAyNTgwDgIBEAIBAQQGAgQyqyjxMBICAQ8CAQEECgIIBvf+gIVyuBwwFAIBAAIBAQQMDApQcm9kdWN0aW9uMBgCAQQCAQIEEDXZIuXFt+8k8Z943qzVWwIwHAIBBQIBAQQUOoUJrZTGXssALA9S5s98RcdNZh4wHgIBCAIBAQQWFhQyMDIzLTAyLTAzVDEzOjA4OjQ1WjAeAgEMAgEBBBYWFDIwMjMtMDItMDNUMTM6MDg6NDVaMB4CARICAQEEFhYUMjAyMy0wMi0wM1QxMjoyMDoxMFowIQIBAgIBAQQZDBdjb20ueW91bGUyMDExLmh5bWFqaWFuZzAxAgEHAgEBBCmqUy0hnS30XTJGa67oy4s2ayyWDIm/eC7rnbh5j5Pn63ZFCRE5ZqSsDjBVAgEGAgEBBE1uPHM1NbMJ34vHNpidCRV0Y8ppytQ9B5PZn57e0Xy7mmR4J89Thwl4WUh3R7kPEiurxX3kJpPegomqYJ3vqluMN7Y8X3fadWbXZYumQDCCAV4CARECAQEEggFUMYIBUDALAgIGrAIBAQQCFgAwCwICBq0CAQEEAgwAMAsCAgaw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GG1sJL5Ky+ERI8GA4nhX1PSZnIIozavcNgs/e66Mv+VNqW2TAYzN39zoHLFbr2g8hDtq6cxlPtdk2f8GHVdmnmbkyQvvY1XGefqFStxu9k0IkEirHDx22TZxeY8hLgBdQqorV2uT80AkHN7B1dSExggGxMIIBrQIBATCBiTB1MQswCQYDVQQGEwJVUzETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UECwwCRzcxRDBCBgNVBAMMO0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENlcnRpZmljYXRpb24gQXV0aG9yaXR5AhAtqwMbvdZlc9IHKXk8RJfEMAkGBSsOAwIaBQAwDQYJKoZIhvcNAQEBBQAEggEAaqDUzwypJ81QT6t9NkTSLLz8DCZ++1kPBHxAXZXirjf/wO/eS4KmEa9AHCsRjRZdwdA9E4Af3GGkLaRhxcNUh7OmkI0vb29iPmLnfsKCuYtoOTaqMtrRMDHC71tfB5TVasCohs0N+6EdW1BoL2j4YcDQgExj9W/xmCSYGmE9vdw3WXvTg1Rllj9yfC68Z73IhNe6tBn/M9N8lzp7PryWeQ1NjLfrafAmJkMM6d7mwoypHCZ7R5d2SqcHCamGEAkXadU6VrOU1GBirBc5odDC1esQG+GyUG4j0i60WtM53UTAehZkucp4bC7Ah4u4XLXbzRNdZR3KxBDw1UYpWfFxYw==")
if err != nil {
t.Fatal(err)
}
t.Log(summary)
if info != nil {
t.Log(summary.Environment, info.TransactionId, info.ProductId)
}
}