Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions misc/examples/events/charge.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
###
POST http://localhost:8080/v1/stripe/charge
Content-Type: application/json

{
"token": "tok_visa",
"voucher": "abcg",
"amount": "650",
"currency": "USD"
}
292 changes: 292 additions & 0 deletions misc/examples/events/webhook.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,292 @@
###
POST http://localhost:8080/v1/stripe/webhook
Content-Type: application/json

{
"id": "evt_3Ls83eLswFpehDNg0dmzogyf",
"object": "event",
"api_version": "2022-08-01",
"created": 1665593127,
"data": {
"object": {
"id": "ch_3Ls83eLswFpehDNg0WVw0vTa",
"object": "charge",
"amount": 250,
"amount_captured": 250,
"amount_refunded": 0,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_3Ls83eLswFpehDNg0dFvPaKv",
"billing_details": {
"address": {
"city": null,
"country": "DE",
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": "a@b.d",
"name": "asdfasf",
"phone": null
},
"calculated_statement_descriptor": "Stripe",
"captured": true,
"created": 1665593127,
"currency": "usd",
"customer": null,
"description": null,
"destination": null,
"dispute": null,
"disputed": false,
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"fraud_details": {},
"invoice": null,
"livemode": false,
"metadata": {},
"on_behalf_of": null,
"order": null,
"outcome": {
"network_status": "approved_by_network",
"reason": null,
"risk_level": "normal",
"risk_score": 21,
"seller_message": "Payment complete.",
"type": "authorized"
},
"paid": true,
"payment_intent": "pi_3Ls83eLswFpehDNg0b2mAFUW",
"payment_method": "pm_1Ls83dLswFpehDNgpYAGL3j9",
"payment_method_details": {
"card": {
"brand": "mastercard",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": "pass"
},
"country": "US",
"exp_month": 12,
"exp_year": 2023,
"fingerprint": "DoAWRfUcyOfJupbL",
"funding": "credit",
"installments": null,
"last4": "4444",
"mandate": null,
"network": "mastercard",
"three_d_secure": null,
"wallet": null
},
"type": "card"
},
"receipt_email": null,
"receipt_number": null,
"receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTGZORGFMc3dGcGVoRE5nKKjem5oGMgZo4m-xDMM6LBadftys-t7FIeo23hfQKTAtYI3zpLwmJb_3-A6VqCpIGjfmpkWUwCDQC38M",
"refunded": false,
"refunds": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "/v1/charges/ch_3Ls83eLswFpehDNg0WVw0vTa/refunds"
},
"review": null,
"shipping": null,
"source": null,
"source_transfer": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
},
"livemode": false,
"pending_webhooks": 2,
"request": {
"id": "req_F8pjOORr12gJT9",
"idempotency_key": "8fdd25c9-cb73-4807-973f-f0b21d8bb7cc"
},
"type": "charge.succeeded"
}


###
POST http://localhost:8080/v1/stripe/webhook
Content-Type: application/json

{
"id": "evt_3Ls83eLswFpehDNg0YbJevK2",
"object": "event",
"api_version": "2022-08-01",
"created": 1665593128,
"data": {
"object": {
"id": "pi_3Ls83eLswFpehDNg0b2mAFUW",
"object": "payment_intent",
"amount": 250,
"amount_capturable": 0,
"amount_details": {
"tip": {}
},
"amount_received": 250,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"charges": {
"object": "list",
"data": [
{
"id": "ch_3Ls83eLswFpehDNg0WVw0vTa",
"object": "charge",
"amount": 250,
"amount_captured": 250,
"amount_refunded": 0,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_3Ls83eLswFpehDNg0dFvPaKv",
"billing_details": {
"address": {
"city": null,
"country": "DE",
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": "a@b.d",
"name": "asdfasf",
"phone": null
},
"calculated_statement_descriptor": "Stripe",
"captured": true,
"created": 1665593127,
"currency": "usd",
"customer": null,
"description": null,
"destination": null,
"dispute": null,
"disputed": false,
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"fraud_details": {},
"invoice": null,
"livemode": false,
"metadata": {},
"on_behalf_of": null,
"order": null,
"outcome": {
"network_status": "approved_by_network",
"reason": null,
"risk_level": "normal",
"risk_score": 21,
"seller_message": "Payment complete.",
"type": "authorized"
},
"paid": true,
"payment_intent": "pi_3Ls83eLswFpehDNg0b2mAFUW",
"payment_method": "pm_1Ls83dLswFpehDNgpYAGL3j9",
"payment_method_details": {
"card": {
"brand": "mastercard",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": "pass"
},
"country": "US",
"exp_month": 12,
"exp_year": 2023,
"fingerprint": "DoAWRfUcyOfJupbL",
"funding": "credit",
"installments": null,
"last4": "4444",
"mandate": null,
"network": "mastercard",
"three_d_secure": null,
"wallet": null
},
"type": "card"
},
"receipt_email": null,
"receipt_number": null,
"receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTGZORGFMc3dGcGVoRE5nKKjem5oGMgbvNEiopYo6LBaa9sMFbxpWzGb2WX9aOuc4LWzXH4hUaNoIgvdvHlJv5zChsx0FH0MJcj6b",
"refunded": false,
"refunds": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "/v1/charges/ch_3Ls83eLswFpehDNg0WVw0vTa/refunds"
},
"review": null,
"shipping": null,
"source": null,
"source_transfer": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/charges?payment_intent=pi_3Ls83eLswFpehDNg0b2mAFUW"
},
"client_secret": "pi_3Ls83eLswFpehDNg0b2mAFUW_secret_72eKxCUCTrTLH0E3dSvrlwmgO",
"confirmation_method": "automatic",
"created": 1665593126,
"currency": "usd",
"customer": null,
"description": null,
"invoice": null,
"last_payment_error": null,
"livemode": false,
"metadata": {},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1Ls83dLswFpehDNgpYAGL3j9",
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
},
"livemode": false,
"pending_webhooks": 2,
"request": {
"id": "req_F8pjOORr12gJT9",
"idempotency_key": "8fdd25c9-cb73-4807-973f-f0b21d8bb7cc"
},
"type": "payment_intent.succeeded"
}



2 changes: 1 addition & 1 deletion nix/materialized.paymentserver/.stack-to-nix.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/PrivateStorageio/servant-prometheus.git 6c8430b802303f9b8a3d11acb0c212b80444ad7c . 09dcwj5ac2x2ilb4a0rai3qhl875vvvjr12af5plpz86faga3lnz servant-prometheus .stack-to-nix.cache.0
https://github.com/PrivateStorageio/servant-prometheus.git 622eb77cb08c5f13729173b8feb123a6700ff91f . 09dcwj5ac2x2ilb4a0rai3qhl875vvvjr12af5plpz86faga3lnz servant-prometheus .stack-to-nix.cache.0
2 changes: 1 addition & 1 deletion nix/materialized.paymentserver/.stack-to-nix.cache.0
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@
};
};
} // rec {
src = (pkgs.lib).mkDefault /nix/store/g62jlfm3vg9dld12fi12f5rkp9sjgbab-servant-prometheus-6c8430b;
src = (pkgs.lib).mkDefault /nix/store/r537z0w0swb6calr6vkk2ppnqd2bgv8z-servant-prometheus-622eb77;
}
4 changes: 3 additions & 1 deletion nix/materialized.paymentserver/PaymentServer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,6 @@
};
};
};
} // rec { src = (pkgs.lib).mkDefault ./.; }
} // rec {
src = (pkgs.lib).mkDefault ./.;
}
Loading