This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test_b_get_field.py | |
from .get_field import get_field | |
from .resource import IMPORTANT_DICT | |
def test_get_field_minimal(): | |
assert get_field() is None | |
def test_get_field_another_key(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
email: { | |
config: { | |
provider: "sendgrid", | |
providerOptions: { | |
apiKey: env("SENDGRID_API_KEY") | |
} | |
}, | |
settings: { | |
defaultFrom: '[email protected]', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X 'POST' \ | |
-H 'accept: application/json' \ | |
-H 'Content-Type: application/json' \ | |
-d '{ | |
"order": { | |
"orderId": "MB45CC6D2V220424GUEST000P01", | |
"extOrderId": "600f0125-6595-4633-a701-f8a2f480d70e", | |
"orderCreateDate": "2022-04-24T11:20:59.521+02:00", | |
"notifyUrl": "https://webhook.site/5e25fb1d-a0cb-47ef-b8f7-f71ca7f7d5cc", | |
"customerIp": "127.0.0.1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"transaction": { | |
"id": 76, | |
"customerIp": "127.0.0.1", | |
"description": "test", | |
"currencyCode": "PLN", | |
"totalAmount": "1000", | |
"buyer": null, | |
"products": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl \ | |
-X 'POST' \ | |
-H 'accept: application/json' \ | |
-H 'Content-Type: application/json' \ | |
-d '{ | |
"currencyCode":"PLN", | |
"totalAmount": "1000", | |
"description":"test", | |
"customerIp": "127.0.0.1", | |
"products": [{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/index.js | |
"use strict"; | |
module.exports = { | |
register(/*{ strapi }*/) {}, | |
bootstrap({ strapi }) { | |
strapi.db.lifecycles.subscribe((event) => { | |
if ( | |
event.action === "afterUpdate" && | |
event.model.uid == "plugin::payu.transaction" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// api/product/services/product.js | |
"use strict"; | |
const { createCoreService } = require("@strapi/strapi").factories; | |
module.exports = createCoreService("api::product.product", ({ strapi }) => ({ | |
async handleTransactionUpdate(event) { | |
const { result } = event; | |
strapi.log.info( | |
`Acting upon an updated transaction - id: ${result.id}, status: ${result.status}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// config/plugins.js | |
module.exports = { | |
payu: { | |
enabled: true, | |
resolve: "./src/plugins/payu", | |
}, | |
shop: { | |
enabled: true, | |
resolve: "./src/plugins/shop", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
action: 'afterUpdate', | |
model: { | |
singularName: 'transaction', | |
uid: 'plugin::payu.transaction', | |
tableName: 'transactions', | |
attributes: { | |
id: [Object], | |
uid: [Object], | |
configurationMode: [Object], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/index.js | |
module.exports = { | |
register(/*{ strapi }*/) {}, | |
bootstrap({ strapi }) { | |
strapi.db.lifecycles.subscribe((event) => { | |
if (event.action === "afterUpdate") { | |
console.log(event); | |
} | |
}); |
NewerOlder