Skip to content

Commit

Permalink
Merge pull request #54 from 64bit/one-time-charge
Browse files Browse the repository at this point in the history
feat: Add ONE_TIME_CHARGE notification type; bug fix for README example
  • Loading branch information
tikhop authored Aug 9, 2024
2 parents ea2ba1d + c175a19 commit 49dcbc8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn main() {

let client = AppStoreServerApiClient::new(encoded_key, key_id, issuer_id, bundle_id, environment);
match client.request_test_notification().await {
Ok(res) => {
Ok(response) => {
println!("{}", response.test_notification_token);
}
Err(err) => {
Expand Down
10 changes: 5 additions & 5 deletions src/api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ use crate::primitives::transaction_info_response::TransactionInfoResponse;

#[derive(Debug, Serialize, Deserialize)]
pub struct APIException {
http_status_code: u16,
api_error: Option<APIError>,
raw_api_error: Option<i64>,
error_message: Option<String>,
pub http_status_code: u16,
pub api_error: Option<APIError>,
pub raw_api_error: Option<i64>,
pub error_message: Option<String>,
}

impl fmt::Display for APIException {
Expand Down Expand Up @@ -1087,4 +1087,4 @@ mod tests {

AppStoreServerAPIClient::new(key, "keyId", "issuerId", "com.example", Environment::LocalTesting, Box::new(request_overrider))
}
}
}
2 changes: 2 additions & 0 deletions src/primitives/notification_type_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ pub enum NotificationTypeV2 {
RefundReversed,
#[serde(rename = "EXTERNAL_PURCHASE_TOKEN")]
ExternalPurchaseToken,
#[serde(rename = "ONE_TIME_CHARGE")]
OneTimeCharge,
}

0 comments on commit 49dcbc8

Please sign in to comment.